pub struct Key {
pub key: String,
pub modifiers: Vec<Modifier>,
pub event_type: KeyEventType,
}Expand description
A parsed key event.
Fields§
§key: StringThe base key (e.g., “a”, “enter”, “f1”).
modifiers: Vec<Modifier>Modifiers pressed.
event_type: KeyEventTypeEvent type (press, release, repeat).
Implementations§
Source§impl Key
impl Key
Sourcepub fn with_modifier(self, modifier: Modifier) -> Self
pub fn with_modifier(self, modifier: Modifier) -> Self
Add a modifier.
Sourcepub fn with_event_type(self, event_type: KeyEventType) -> Self
pub fn with_event_type(self, event_type: KeyEventType) -> Self
Set the event type.
Trait Implementations§
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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