Trait KeyboardClient

Source
pub trait KeyboardClient {
    // Required method
    fn keys_pressed(&self, keys: &[(u16, bool)], result: Result<(), ErrorCode>);
}
Expand description

Receiver for keyboard key presses.

Required Methods§

Source

fn keys_pressed(&self, keys: &[(u16, bool)], result: Result<(), ErrorCode>)

Called when one or more keys are pressed or un-pressed.

keys is an array of (key_code, is_pressed) tuples. key_code is the same as the codes used by Linux to identify different keys. is_pressed is true if the key was pressed, and false if the key was un-pressed. A list of keycodes can be found here: https://manpages.ubuntu.com/manpages/focal/man7/virkeycode-linux.7.html

result is Ok(()) if the keys were received correctly.

Implementors§