pub struct KeyEvent {
pub time_ms: u32,
pub key: u32,
pub pressed: bool,
pub repeat: bool,
pub sym: u32,
pub utf8: String,
}Expand description
A key going down or coming up.
key is the evdev code – KEY_A, KEY_LEFTSHIFT – with no xkb offset
applied. Keyboard::process_key fills in
sym and utf8; until it has, both are empty.
Fields§
§time_ms: u32libinput’s timestamp, in milliseconds.
key: u32The evdev keycode, without xkb’s + 8.
pressed: boolDown, rather than up.
repeat: boolSynthesized by the repeater rather than produced by a device.
sym: u32The xkb keysym this resolved to.
utf8: StringWhat the key types, if anything.
The reference carries a char[8], so it truncates anything longer
than seven bytes. Nothing a single keysym produces reaches that, but
there is no reason to inherit the cliff.
Trait Implementations§
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§
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