keyboard: Introduce a KeyCode type wrapping u32

This commit is contained in:
Dorota Czaplejewicz
2019-12-17 12:27:26 +00:00
parent e77eccf7db
commit 950310c8a5

View File

@ -17,12 +17,14 @@ pub enum PressType {
Pressed = 1, Pressed = 1,
} }
pub type KeyCode = u32;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct KeyState { pub struct KeyState {
pub pressed: PressType, pub pressed: PressType,
pub locked: bool, pub locked: bool,
/// A cache of raw keycodes derived from Action::Sumbit given a keymap /// A cache of raw keycodes derived from Action::Sumbit given a keymap
pub keycodes: Vec<u32>, pub keycodes: Vec<KeyCode>,
/// Static description of what the key does when pressed or released /// Static description of what the key does when pressed or released
pub action: Action, pub action: Action,
} }