// This file was generated automatically

#[repr(u8)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Key {
    CapsLock,
    Shift,
    Control,
    Alt,
    Meta,
    ControlOrMeta,
    RightShift,
    RightControl,
    RightAlt,
    RightMeta,
    RightControlOrMeta,
    Fn,
    ReturnOrEnter,
    Escape,
    DeleteOrBackspace,
    ForwardDelete,
    Tab,
    Space,
    Minus,
    Equal,
    LeftBracket,
    RightBracket,
    Backslash,
    Semicolon,
    Quote,
    Grave,
    Comma,
    Period,
    Slash,
    UpArrow,
    RightArrow,
    DownArrow,
    LeftArrow,
    PageUp,
    PageDown,
    Home,
    End,
    A,
    B,
    C,
    D,
    E,
    F,
    G,
    H,
    I,
    J,
    K,
    L,
    M,
    N,
    O,
    P,
    Q,
    R,
    S,
    T,
    U,
    V,
    W,
    X,
    Y,
    Z,
    N0,
    N1,
    N2,
    N3,
    N4,
    N5,
    N6,
    N7,
    N8,
    N9,
    Numpad0,
    Numpad1,
    Numpad2,
    Numpad3,
    Numpad4,
    Numpad5,
    Numpad6,
    Numpad7,
    Numpad8,
    Numpad9,
    NumpadClear,
    NumpadEquals,
    NumpadDivide,
    NumpadMultiply,
    NumpadMinus,
    NumpadPlus,
    NumpadEnter,
    NumpadDecimal,
    F1,
    F2,
    F3,
    F4,
    F5,
    F6,
    F7,
    F8,
    F9,
    F10,
    F11,
    F12,
    FastForward,
    Rewind,
    PlayPause,
    VolumeUp,
    VolumeDown,
    Mute,
}

impl Key {
    pub const COUNT: u8 = 109;
}

impl std::str::FromStr for Key {
    type Err = ();

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        use Key::*;
        match s {
            "capslock" => Ok(CapsLock),
            "shift" => Ok(Shift),
            "control" => Ok(Control),
            "alt" => Ok(Alt),
            "meta" => Ok(Meta),
            "controlormeta" => Ok(ControlOrMeta),
            "rightshift" => Ok(RightShift),
            "rightcontrol" => Ok(RightControl),
            "rightalt" => Ok(RightAlt),
            "rightmeta" => Ok(RightMeta),
            "rightcontrolormeta" => Ok(RightControlOrMeta),
            "fn" => Ok(Fn),
            "returnorenter" => Ok(ReturnOrEnter),
            "escape" => Ok(Escape),
            "deleteorbackspace" => Ok(DeleteOrBackspace),
            "forwarddelete" => Ok(ForwardDelete),
            "tab" => Ok(Tab),
            "space" => Ok(Space),
            "minus" => Ok(Minus),
            "equal" => Ok(Equal),
            "leftbracket" => Ok(LeftBracket),
            "rightbracket" => Ok(RightBracket),
            "backslash" => Ok(Backslash),
            "semicolon" => Ok(Semicolon),
            "quote" => Ok(Quote),
            "grave" => Ok(Grave),
            "comma" => Ok(Comma),
            "period" => Ok(Period),
            "slash" => Ok(Slash),
            "uparrow" => Ok(UpArrow),
            "rightarrow" => Ok(RightArrow),
            "downarrow" => Ok(DownArrow),
            "leftarrow" => Ok(LeftArrow),
            "pageup" => Ok(PageUp),
            "pagedown" => Ok(PageDown),
            "home" => Ok(Home),
            "end" => Ok(End),
            "a" => Ok(A),
            "b" => Ok(B),
            "c" => Ok(C),
            "d" => Ok(D),
            "e" => Ok(E),
            "f" => Ok(F),
            "g" => Ok(G),
            "h" => Ok(H),
            "i" => Ok(I),
            "j" => Ok(J),
            "k" => Ok(K),
            "l" => Ok(L),
            "m" => Ok(M),
            "n" => Ok(N),
            "o" => Ok(O),
            "p" => Ok(P),
            "q" => Ok(Q),
            "r" => Ok(R),
            "s" => Ok(S),
            "t" => Ok(T),
            "u" => Ok(U),
            "v" => Ok(V),
            "w" => Ok(W),
            "x" => Ok(X),
            "y" => Ok(Y),
            "z" => Ok(Z),
            "0" => Ok(N0),
            "1" => Ok(N1),
            "2" => Ok(N2),
            "3" => Ok(N3),
            "4" => Ok(N4),
            "5" => Ok(N5),
            "6" => Ok(N6),
            "7" => Ok(N7),
            "8" => Ok(N8),
            "9" => Ok(N9),
            "numpad0" => Ok(Numpad0),
            "numpad1" => Ok(Numpad1),
            "numpad2" => Ok(Numpad2),
            "numpad3" => Ok(Numpad3),
            "numpad4" => Ok(Numpad4),
            "numpad5" => Ok(Numpad5),
            "numpad6" => Ok(Numpad6),
            "numpad7" => Ok(Numpad7),
            "numpad8" => Ok(Numpad8),
            "numpad9" => Ok(Numpad9),
            "numpadclear" => Ok(NumpadClear),
            "numpadequals" => Ok(NumpadEquals),
            "numpaddivide" => Ok(NumpadDivide),
            "numpadmultiply" => Ok(NumpadMultiply),
            "numpadminus" => Ok(NumpadMinus),
            "numpadplus" => Ok(NumpadPlus),
            "numpadenter" => Ok(NumpadEnter),
            "numpaddecimal" => Ok(NumpadDecimal),
            "f1" => Ok(F1),
            "f2" => Ok(F2),
            "f3" => Ok(F3),
            "f4" => Ok(F4),
            "f5" => Ok(F5),
            "f6" => Ok(F6),
            "f7" => Ok(F7),
            "f8" => Ok(F8),
            "f9" => Ok(F9),
            "f10" => Ok(F10),
            "f11" => Ok(F11),
            "f12" => Ok(F12),
            "fastforward" => Ok(FastForward),
            "rewind" => Ok(Rewind),
            "playpause" => Ok(PlayPause),
            "volumeup" => Ok(VolumeUp),
            "volumedown" => Ok(VolumeDown),
            "mute" => Ok(Mute),
            _ => Err(()),
        }
    }
}
