use winit::keyboard::KeyCode as Key;

use crate::input::KeyCode;

pub fn to_key_code(key: Key) -> KeyCode {
    use KeyCode::*;

    match key {
        Key::KeyA => KeyA,
        Key::KeyB => KeyB,
        Key::KeyC => KeyC,
        Key::KeyD => KeyD,
        Key::KeyE => KeyE,
        Key::KeyF => KeyF,
        Key::KeyG => KeyG,
        Key::KeyH => KeyH,
        Key::KeyI => KeyI,
        Key::KeyJ => KeyJ,
        Key::KeyK => KeyK,
        Key::KeyL => KeyL,
        Key::KeyM => KeyM,
        Key::KeyN => KeyN,
        Key::KeyO => KeyO,
        Key::KeyP => KeyP,
        Key::KeyQ => KeyQ,
        Key::KeyR => KeyR,
        Key::KeyS => KeyS,
        Key::KeyT => KeyT,
        Key::KeyU => KeyU,
        Key::KeyV => KeyV,
        Key::KeyW => KeyW,
        Key::KeyX => KeyX,
        Key::KeyY => KeyY,
        Key::KeyZ => KeyZ,
        Key::Digit1 => Digit1,
        Key::Digit2 => Digit2,
        Key::Digit3 => Digit3,
        Key::Digit4 => Digit4,
        Key::Digit5 => Digit5,
        Key::Digit6 => Digit6,
        Key::Digit7 => Digit7,
        Key::Digit8 => Digit8,
        Key::Digit9 => Digit9,
        Key::Digit0 => Digit0,
        Key::Enter => Return,
        Key::Escape => Escape,
        Key::Backspace => BackSpace,
        Key::Tab => Tab,
        Key::Space => Space,
        Key::Minus => Minus,
        Key::Equal => Equals,
        Key::BracketLeft => LeftBracket,
        Key::BracketRight => RightBracket,
        Key::Backslash => BackSlash,
        Key::NumpadHash => Hash,
        Key::Semicolon => SemiColon,
        Key::Quote => Apostrophe,
        Key::Comma => Comma,
        Key::Period => Period,
        Key::Slash => Slash,
        Key::CapsLock => CapsLock,
        Key::F1 => F1,
        Key::F2 => F2,
        Key::F3 => F3,
        Key::F4 => F4,
        Key::F5 => F5,
        Key::F6 => F6,
        Key::F7 => F7,
        Key::F8 => F8,
        Key::F9 => F9,
        Key::F10 => F10,
        Key::F11 => F11,
        Key::F12 => F12,
        Key::PrintScreen => PrintScreen,
        Key::ScrollLock => ScrollLock,
        Key::Pause => Pause,
        Key::Insert => Insert,
        Key::Home => Home,
        Key::PageUp => PageUp,
        Key::PageDown => PageDown,
        Key::Delete => Delete,
        Key::End => End,
        Key::ArrowRight => Right,
        Key::ArrowLeft => Left,
        Key::ArrowUp => Up,
        Key::ArrowDown => Down,
        Key::NumLock => NumLock,
        Key::NumpadDivide => NumpadDiv,
        Key::NumpadMultiply => NumpadMulti,
        Key::NumpadSubtract => NumpadMinus,
        Key::NumpadEnter => NumpadEnter,
        Key::Numpad1 => Numpad1,
        Key::Numpad2 => Numpad2,
        Key::Numpad3 => Numpad3,
        Key::Numpad4 => Numpad4,
        Key::Numpad5 => Numpad5,
        Key::Numpad6 => Numpad6,
        Key::Numpad7 => Numpad7,
        Key::Numpad8 => Numpad8,
        Key::Numpad9 => Numpad9,
        Key::Numpad0 => Numpad0,
        Key::ControlLeft => LeftControl,
        Key::ControlRight => RightControl,
        Key::ShiftLeft => LeftShift,
        Key::ShiftRight => RightShift,
        Key::AltLeft => LeftAlt,
        Key::AltRight => RightAlt,
        _ => Invalid,
    }
}
