#[derive(Clone, Debug, PartialEq)]
pub struct KeyEvent {
pub state: KeyState,
pub keycode: Option<Keycode>,
pub is_repeat: bool,
pub text: Option<String>,
pub modifiers: KeyModifiers,
}
#[derive(Clone, Debug, PartialEq)]
pub enum KeyState {
Pressed,
Released,
}
#[derive(Clone, Debug, PartialEq)]
pub enum Keycode {
Esc,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
PrintScreen,
ScrollLock,
Pause,
Insert,
Delete,
Home,
End,
PageUp,
PageDown,
Left,
Right,
Up,
Down,
Shift,
Ctrl,
Win,
Alt,
AltGr,
Menu,
Backspace,
Tab,
CapsLock,
Return,
Enter,
Space,
QuoteLeft,
Minus,
Equal,
Asterisk,
Plus,
Period,
Slash,
BracketLeft,
BracketRight,
Backslash,
Semicolon,
Quote,
Comma,
KeyA,
KeyB,
KeyC,
KeyD,
KeyE,
KeyF,
KeyG,
KeyH,
KeyI,
KeyJ,
KeyK,
KeyL,
KeyM,
KeyN,
KeyO,
KeyP,
KeyQ,
KeyR,
KeyS,
KeyT,
KeyU,
KeyV,
KeyW,
KeyX,
KeyY,
KeyZ,
Key0,
Key1,
Key2,
Key3,
Key4,
Key5,
Key6,
Key7,
Key8,
Key9,
NumLock,
}
#[derive(Clone, Debug, PartialEq)]
pub struct KeyModifiers {
pub shift: bool,
pub ctrl: bool,
pub alt: bool,
pub win: bool,
pub keypad: bool,
pub right: bool,
}