pub struct KeyPress {
pub key: Key,
pub modifiers: KeyModifiers,
}Expand description
A key press event: a key combined with modifier state.
Parses combo strings like "Ctrl+s", "Shift + Enter",
"Ctrl+Shift+ArrowUp". Also converts from a bare Key
(no modifiers) or a (Key, KeyModifiers) tuple.
Fields§
§key: KeyKey.
modifiers: KeyModifiersActive modifier keys.
Implementations§
Trait Implementations§
Source§impl From<(Key, KeyModifiers)> for KeyPress
impl From<(Key, KeyModifiers)> for KeyPress
Source§fn from((key, modifiers): (Key, KeyModifiers)) -> Self
fn from((key, modifiers): (Key, KeyModifiers)) -> Self
Converts to this type from the input type.
impl Eq for KeyPress
impl StructuralPartialEq for KeyPress
Auto Trait Implementations§
impl Freeze for KeyPress
impl RefUnwindSafe for KeyPress
impl Send for KeyPress
impl Sync for KeyPress
impl Unpin for KeyPress
impl UnsafeUnpin for KeyPress
impl UnwindSafe for KeyPress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more