pub struct KeyEvent {
pub key: Key,
pub pressed: bool,
pub mods: Modifiers,
}Expand description
A change in one key’s state, with the modifiers held after the change.
Fields§
§key: KeyThe physical key.
pressed: booltrue on press, false on release.
mods: ModifiersModifiers held after this event was applied.
Implementations§
Source§impl KeyEvent
impl KeyEvent
Sourcepub fn action(&self) -> Option<Action>
pub fn action(&self) -> Option<Action>
The action this event triggers: None for releases and for keys
that only act as modifiers.
Fn takes precedence over Shift, matching the Cardputer’s printed
orange legends. Ctrl, Alt and Opt don’t change the resolved action;
read them from mods for shortcuts.
Trait Implementations§
impl Copy for KeyEvent
impl Eq for KeyEvent
impl StructuralPartialEq for KeyEvent
Auto Trait Implementations§
impl Freeze for KeyEvent
impl RefUnwindSafe for KeyEvent
impl Send for KeyEvent
impl Sync for KeyEvent
impl Unpin for KeyEvent
impl UnsafeUnpin for KeyEvent
impl UnwindSafe for KeyEvent
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)