use std::fmt;
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum Key {
Q,
W,
E,
R,
T,
Y,
U,
I,
O,
P,
A,
S,
D,
F,
G,
H,
J,
K,
L,
Z,
X,
C,
V,
B,
N,
M,
One,
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine,
Zero,
Grave,
Hyphen,
Equal,
LeftBracket,
RightBracket,
Backslash,
SemiColon,
Apostrophe,
Comma,
Period,
QuestionMark,
Esc,
Tab,
CapsLock,
LeftShift,
LeftCtrl,
LeftSuper,
LeftAlt,
Spacebar,
RightAlt,
RightSuper,
RightCtrl,
RightShift,
Return,
Backspace,
Insert,
Home,
PgUp,
Delete,
End,
PgDown,
Command,
ArrowUp,
ArrowDown,
ArrowLeft,
ArrowRight,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
Separator,
PrintScreen,
ScrollLock,
PauseBreak,
NumLock,
Div,
Mul,
Minus,
Plus,
Decimal,
NumpadEnter,
NumpadZero,
NumpadOne,
NumpadTwo,
NumpadThree,
NumpadFour,
NumpadFive,
NumpadSix,
NumpadSeven,
NumpadEight,
NumpadNine,
}
impl fmt::Display for Key {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Key::CapsLock => write!(f, "Caps"),
Key::Backspace => write!(f, "Back"),
Key::LeftShift => write!(f, "Shift"),
Key::LeftCtrl => write!(f, "Ctrl"),
Key::LeftSuper => write!(f, "Super"),
Key::LeftAlt => write!(f, "Alt"),
Key::LeftBracket => write!(f, "{{["),
Key::RightShift => write!(f, "Shift"),
Key::RightCtrl => write!(f, "Ctrl"),
Key::RightSuper => write!(f, "Super"),
Key::RightAlt => write!(f, "Alt"),
Key::RightBracket => write!(f, "}}]"),
Key::Backslash => write!(f, "|\\"),
Key::SemiColon => write!(f, ":;"),
Key::Apostrophe => write!(f, "\"'"),
Key::Comma => write!(f, "<,"),
Key::Period => write!(f, ">."),
Key::QuestionMark => write!(f, "?/"),
Key::One => write!(f, "1"),
Key::Two => write!(f, "2"),
Key::Three => write!(f, "3"),
Key::Four => write!(f, "4"),
Key::Five => write!(f, "5"),
Key::Six => write!(f, "6"),
Key::Seven => write!(f, "7"),
Key::Eight => write!(f, "8"),
Key::Nine => write!(f, "9"),
Key::Zero => write!(f, "0"),
Key::Hyphen => write!(f, "-"),
Key::Equal => write!(f, "+"),
Key::Grave => write!(f, "~`"),
Key::ArrowUp => write!(f, "↑"),
Key::ArrowDown => write!(f, "↓"),
Key::ArrowLeft => write!(f, "←"),
Key::ArrowRight => write!(f, "→"),
Key::PauseBreak => write!(f, "P/B"),
Key::PrintScreen => write!(f, "Prn"),
Key::ScrollLock => write!(f, "Lck"),
Key::Separator => write!(f, ""),
Key::NumLock => write!(f, "NLck"),
Key::Div => write!(f, "/"),
Key::Mul => write!(f, "*"),
Key::Minus => write!(f, "-"),
Key::Plus => write!(f, "+"),
Key::Decimal => write!(f, "."),
Key::NumpadEnter => write!(f, "Enter"),
Key::NumpadZero => write!(f, "0"),
Key::NumpadOne => write!(f, "1"),
Key::NumpadTwo => write!(f, "2"),
Key::NumpadThree => write!(f, "3"),
Key::NumpadFour => write!(f, "4"),
Key::NumpadFive => write!(f, "5"),
Key::NumpadSix => write!(f, "6"),
Key::NumpadSeven => write!(f, "7"),
Key::NumpadEight => write!(f, "8"),
Key::NumpadNine => write!(f, "9"),
_ => write!(f, "{:?}", self),
}
}
}