Struct wayland_kbd::KeyEvent [] [src]

pub struct KeyEvent {
    pub keycode: u32,
    pub serial: u32,
    pub time: u32,
    pub keystate: WlKeyboardKeyState,
    // some fields omitted
}

Fields

keycode

The raw keycode associated with this event. Only use it if you know what you're doing.

serial
time
keystate

Methods

impl KeyEvent

fn as_utf8(&self) -> Option<String>

Tries to retrieve the key event as an UTF8 sequence

fn as_symbol(&self) -> Option<u32>

Tries to match this key event as a key symbol according to current keyboard state.

Returns 0 if not possible (meaning that this keycode maps to more than one key symbol).