#![allow(missing_docs)]
use crate::bind;
use super::key_code::KeyCode;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[non_exhaustive]
pub enum ScanCode {
Unknown,
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,
Num1,
Num2,
Num3,
Num4,
Num5,
Num6,
Num7,
Num8,
Num9,
Num0,
Return,
Escape,
Backspace,
Tab,
Space,
Minus,
Equals,
LeftBracket,
RightBracket,
Backslash,
NonUsHash,
Semicolon,
Apostrophe,
Grave,
Comma,
Period,
Slash,
CapsLock,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
PrintScreen,
ScrollLock,
Pause,
Insert,
Home,
PageUp,
Delete,
End,
PageDown,
Right,
Left,
Down,
Up,
NumLockClear,
KeypadDivide,
KeypadMultiply,
KeypadMinus,
KeypadPlus,
KeypadEnter,
Keypad1,
Keypad2,
Keypad3,
Keypad4,
Keypad5,
Keypad6,
Keypad7,
Keypad8,
Keypad9,
Keypad0,
KeypadPeriod,
NonUsBackslash,
Application,
Power,
KeypadEquals,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
Execute,
Help,
Menu,
Select,
Stop,
Again,
Undo,
Cut,
Copy,
Paste,
Find,
Mute,
VolumeUp,
VolumeDown,
KeypadComma,
KeypadEqualsAs400,
International1,
International2,
International3,
International4,
International5,
International6,
International7,
International8,
International9,
Lang1,
Lang2,
Lang3,
Lang4,
Lang5,
Lang6,
Lang7,
Lang8,
Lang9,
AltErase,
SysReq,
Cancel,
Clear,
Prior,
Return2,
Separator,
Out,
Oper,
ClearAgain,
CrSel,
ExSel,
Keypad00,
Keypad000,
ThousandsSeparator,
DecimalSeparator,
CurrencyUnit,
CurrencySubunit,
KeypadLeftParen,
KeypadRightParen,
KeypadLeftBrace,
KeypadRightBrace,
KeypadTab,
KeypadBackspace,
KeypadA,
KeypadB,
KeypadC,
KeypadD,
KeypadE,
KeypadF,
KeypadXor,
KeypadPower,
KeypadPercent,
KeypadLess,
KeypadGreater,
KeypadAmpersand,
KeypadDblAmpersand,
KeypadVerticalBar,
KeypadDblVerticalBar,
KeypadColon,
KeypadHash,
KeypadSpace,
KeypadAt,
KeypadExclam,
KeypadMemStore,
KeypadMemRecall,
KeypadMemClear,
KeypadMemAdd,
KeypadMemSubtract,
KeypadMemMultiply,
KeypadMemDivide,
KeypadPlusMinus,
KeypadClear,
KeypadClearEntry,
KeypadBinary,
KeypadOctal,
KeypadDecimal,
KeypadHexadecimal,
LCtrl,
LShift,
LAlt,
LGui,
RCtrl,
RShift,
RAlt,
RGui,
Mode,
AudioNext,
AudioPrev,
AudioStop,
AudioPlay,
AudioMute,
MediaSelect,
Www,
Mail,
Calculator,
Computer,
ApplicationSearch,
ApplicationHome,
ApplicationBack,
ApplicationForward,
ApplicationStop,
ApplicationRefresh,
ApplicationBookmarks,
BrightnessDown,
BrightnessUp,
DisplaySwitch,
KeyboardIllumToggle,
KeyboardIllumDown,
KeyboardIllumUp,
Eject,
Sleep,
App1,
App2,
AudioRewind,
AudioFastForward,
}
pub const NUM_SCANCODES: u16 = 512;
impl ScanCode {
pub(crate) fn as_raw(self) -> bind::SDL_Scancode {
match self {
ScanCode::Unknown => bind::SDL_SCANCODE_UNKNOWN,
ScanCode::A => bind::SDL_SCANCODE_A,
ScanCode::B => bind::SDL_SCANCODE_B,
ScanCode::C => bind::SDL_SCANCODE_C,
ScanCode::D => bind::SDL_SCANCODE_D,
ScanCode::E => bind::SDL_SCANCODE_E,
ScanCode::F => bind::SDL_SCANCODE_F,
ScanCode::G => bind::SDL_SCANCODE_G,
ScanCode::H => bind::SDL_SCANCODE_H,
ScanCode::I => bind::SDL_SCANCODE_I,
ScanCode::J => bind::SDL_SCANCODE_J,
ScanCode::K => bind::SDL_SCANCODE_K,
ScanCode::L => bind::SDL_SCANCODE_L,
ScanCode::M => bind::SDL_SCANCODE_M,
ScanCode::N => bind::SDL_SCANCODE_N,
ScanCode::O => bind::SDL_SCANCODE_O,
ScanCode::P => bind::SDL_SCANCODE_P,
ScanCode::Q => bind::SDL_SCANCODE_Q,
ScanCode::R => bind::SDL_SCANCODE_R,
ScanCode::S => bind::SDL_SCANCODE_S,
ScanCode::T => bind::SDL_SCANCODE_T,
ScanCode::U => bind::SDL_SCANCODE_U,
ScanCode::V => bind::SDL_SCANCODE_V,
ScanCode::W => bind::SDL_SCANCODE_W,
ScanCode::X => bind::SDL_SCANCODE_X,
ScanCode::Y => bind::SDL_SCANCODE_Y,
ScanCode::Z => bind::SDL_SCANCODE_Z,
ScanCode::Num1 => bind::SDL_SCANCODE_1,
ScanCode::Num2 => bind::SDL_SCANCODE_2,
ScanCode::Num3 => bind::SDL_SCANCODE_3,
ScanCode::Num4 => bind::SDL_SCANCODE_4,
ScanCode::Num5 => bind::SDL_SCANCODE_5,
ScanCode::Num6 => bind::SDL_SCANCODE_6,
ScanCode::Num7 => bind::SDL_SCANCODE_7,
ScanCode::Num8 => bind::SDL_SCANCODE_8,
ScanCode::Num9 => bind::SDL_SCANCODE_9,
ScanCode::Num0 => bind::SDL_SCANCODE_0,
ScanCode::Return => bind::SDL_SCANCODE_RETURN,
ScanCode::Escape => bind::SDL_SCANCODE_ESCAPE,
ScanCode::Backspace => bind::SDL_SCANCODE_BACKSPACE,
ScanCode::Tab => bind::SDL_SCANCODE_TAB,
ScanCode::Space => bind::SDL_SCANCODE_SPACE,
ScanCode::Minus => bind::SDL_SCANCODE_MINUS,
ScanCode::Equals => bind::SDL_SCANCODE_EQUALS,
ScanCode::LeftBracket => bind::SDL_SCANCODE_LEFTBRACKET,
ScanCode::RightBracket => bind::SDL_SCANCODE_RIGHTBRACKET,
ScanCode::Backslash => bind::SDL_SCANCODE_BACKSLASH,
ScanCode::NonUsHash => bind::SDL_SCANCODE_NONUSHASH,
ScanCode::Semicolon => bind::SDL_SCANCODE_SEMICOLON,
ScanCode::Apostrophe => bind::SDL_SCANCODE_APOSTROPHE,
ScanCode::Grave => bind::SDL_SCANCODE_GRAVE,
ScanCode::Comma => bind::SDL_SCANCODE_COMMA,
ScanCode::Period => bind::SDL_SCANCODE_PERIOD,
ScanCode::Slash => bind::SDL_SCANCODE_SLASH,
ScanCode::CapsLock => bind::SDL_SCANCODE_CAPSLOCK,
ScanCode::F1 => bind::SDL_SCANCODE_F1,
ScanCode::F2 => bind::SDL_SCANCODE_F2,
ScanCode::F3 => bind::SDL_SCANCODE_F3,
ScanCode::F4 => bind::SDL_SCANCODE_F4,
ScanCode::F5 => bind::SDL_SCANCODE_F5,
ScanCode::F6 => bind::SDL_SCANCODE_F6,
ScanCode::F7 => bind::SDL_SCANCODE_F7,
ScanCode::F8 => bind::SDL_SCANCODE_F8,
ScanCode::F9 => bind::SDL_SCANCODE_F9,
ScanCode::F10 => bind::SDL_SCANCODE_F10,
ScanCode::F11 => bind::SDL_SCANCODE_F11,
ScanCode::F12 => bind::SDL_SCANCODE_F12,
ScanCode::PrintScreen => bind::SDL_SCANCODE_PRINTSCREEN,
ScanCode::ScrollLock => bind::SDL_SCANCODE_SCROLLLOCK,
ScanCode::Pause => bind::SDL_SCANCODE_PAUSE,
ScanCode::Insert => bind::SDL_SCANCODE_INSERT,
ScanCode::Home => bind::SDL_SCANCODE_HOME,
ScanCode::PageUp => bind::SDL_SCANCODE_PAGEUP,
ScanCode::Delete => bind::SDL_SCANCODE_DELETE,
ScanCode::End => bind::SDL_SCANCODE_END,
ScanCode::PageDown => bind::SDL_SCANCODE_PAGEDOWN,
ScanCode::Right => bind::SDL_SCANCODE_RIGHT,
ScanCode::Left => bind::SDL_SCANCODE_LEFT,
ScanCode::Down => bind::SDL_SCANCODE_DOWN,
ScanCode::Up => bind::SDL_SCANCODE_UP,
ScanCode::NumLockClear => bind::SDL_SCANCODE_NUMLOCKCLEAR,
ScanCode::KeypadDivide => bind::SDL_SCANCODE_KP_DIVIDE,
ScanCode::KeypadMultiply => bind::SDL_SCANCODE_KP_MULTIPLY,
ScanCode::KeypadMinus => bind::SDL_SCANCODE_KP_MINUS,
ScanCode::KeypadPlus => bind::SDL_SCANCODE_KP_PLUS,
ScanCode::KeypadEnter => bind::SDL_SCANCODE_KP_ENTER,
ScanCode::Keypad1 => bind::SDL_SCANCODE_KP_1,
ScanCode::Keypad2 => bind::SDL_SCANCODE_KP_2,
ScanCode::Keypad3 => bind::SDL_SCANCODE_KP_3,
ScanCode::Keypad4 => bind::SDL_SCANCODE_KP_4,
ScanCode::Keypad5 => bind::SDL_SCANCODE_KP_5,
ScanCode::Keypad6 => bind::SDL_SCANCODE_KP_6,
ScanCode::Keypad7 => bind::SDL_SCANCODE_KP_7,
ScanCode::Keypad8 => bind::SDL_SCANCODE_KP_8,
ScanCode::Keypad9 => bind::SDL_SCANCODE_KP_9,
ScanCode::Keypad0 => bind::SDL_SCANCODE_KP_0,
ScanCode::KeypadPeriod => bind::SDL_SCANCODE_KP_PERIOD,
ScanCode::NonUsBackslash => bind::SDL_SCANCODE_NONUSBACKSLASH,
ScanCode::Application => bind::SDL_SCANCODE_APPLICATION,
ScanCode::Power => bind::SDL_SCANCODE_POWER,
ScanCode::KeypadEquals => bind::SDL_SCANCODE_KP_EQUALS,
ScanCode::F13 => bind::SDL_SCANCODE_F13,
ScanCode::F14 => bind::SDL_SCANCODE_F14,
ScanCode::F15 => bind::SDL_SCANCODE_F15,
ScanCode::F16 => bind::SDL_SCANCODE_F16,
ScanCode::F17 => bind::SDL_SCANCODE_F17,
ScanCode::F18 => bind::SDL_SCANCODE_F18,
ScanCode::F19 => bind::SDL_SCANCODE_F19,
ScanCode::F20 => bind::SDL_SCANCODE_F20,
ScanCode::F21 => bind::SDL_SCANCODE_F21,
ScanCode::F22 => bind::SDL_SCANCODE_F22,
ScanCode::F23 => bind::SDL_SCANCODE_F23,
ScanCode::F24 => bind::SDL_SCANCODE_F24,
ScanCode::Execute => bind::SDL_SCANCODE_EXECUTE,
ScanCode::Help => bind::SDL_SCANCODE_HELP,
ScanCode::Menu => bind::SDL_SCANCODE_MENU,
ScanCode::Select => bind::SDL_SCANCODE_SELECT,
ScanCode::Stop => bind::SDL_SCANCODE_STOP,
ScanCode::Again => bind::SDL_SCANCODE_AGAIN,
ScanCode::Undo => bind::SDL_SCANCODE_UNDO,
ScanCode::Cut => bind::SDL_SCANCODE_CUT,
ScanCode::Copy => bind::SDL_SCANCODE_COPY,
ScanCode::Paste => bind::SDL_SCANCODE_PASTE,
ScanCode::Find => bind::SDL_SCANCODE_FIND,
ScanCode::Mute => bind::SDL_SCANCODE_MUTE,
ScanCode::VolumeUp => bind::SDL_SCANCODE_VOLUMEUP,
ScanCode::VolumeDown => bind::SDL_SCANCODE_VOLUMEDOWN,
ScanCode::KeypadComma => bind::SDL_SCANCODE_KP_COMMA,
ScanCode::KeypadEqualsAs400 => bind::SDL_SCANCODE_KP_EQUALSAS400,
ScanCode::International1 => bind::SDL_SCANCODE_INTERNATIONAL1,
ScanCode::International2 => bind::SDL_SCANCODE_INTERNATIONAL2,
ScanCode::International3 => bind::SDL_SCANCODE_INTERNATIONAL3,
ScanCode::International4 => bind::SDL_SCANCODE_INTERNATIONAL4,
ScanCode::International5 => bind::SDL_SCANCODE_INTERNATIONAL5,
ScanCode::International6 => bind::SDL_SCANCODE_INTERNATIONAL6,
ScanCode::International7 => bind::SDL_SCANCODE_INTERNATIONAL7,
ScanCode::International8 => bind::SDL_SCANCODE_INTERNATIONAL8,
ScanCode::International9 => bind::SDL_SCANCODE_INTERNATIONAL9,
ScanCode::Lang1 => bind::SDL_SCANCODE_LANG1,
ScanCode::Lang2 => bind::SDL_SCANCODE_LANG2,
ScanCode::Lang3 => bind::SDL_SCANCODE_LANG3,
ScanCode::Lang4 => bind::SDL_SCANCODE_LANG4,
ScanCode::Lang5 => bind::SDL_SCANCODE_LANG5,
ScanCode::Lang6 => bind::SDL_SCANCODE_LANG6,
ScanCode::Lang7 => bind::SDL_SCANCODE_LANG7,
ScanCode::Lang8 => bind::SDL_SCANCODE_LANG8,
ScanCode::Lang9 => bind::SDL_SCANCODE_LANG9,
ScanCode::AltErase => bind::SDL_SCANCODE_ALTERASE,
ScanCode::SysReq => bind::SDL_SCANCODE_SYSREQ,
ScanCode::Cancel => bind::SDL_SCANCODE_CANCEL,
ScanCode::Clear => bind::SDL_SCANCODE_CLEAR,
ScanCode::Prior => bind::SDL_SCANCODE_PRIOR,
ScanCode::Return2 => bind::SDL_SCANCODE_RETURN2,
ScanCode::Separator => bind::SDL_SCANCODE_SEPARATOR,
ScanCode::Out => bind::SDL_SCANCODE_OUT,
ScanCode::Oper => bind::SDL_SCANCODE_OPER,
ScanCode::ClearAgain => bind::SDL_SCANCODE_CLEARAGAIN,
ScanCode::CrSel => bind::SDL_SCANCODE_CRSEL,
ScanCode::ExSel => bind::SDL_SCANCODE_EXSEL,
ScanCode::Keypad00 => bind::SDL_SCANCODE_KP_00,
ScanCode::Keypad000 => bind::SDL_SCANCODE_KP_000,
ScanCode::ThousandsSeparator => bind::SDL_SCANCODE_THOUSANDSSEPARATOR,
ScanCode::DecimalSeparator => bind::SDL_SCANCODE_DECIMALSEPARATOR,
ScanCode::CurrencyUnit => bind::SDL_SCANCODE_CURRENCYUNIT,
ScanCode::CurrencySubunit => bind::SDL_SCANCODE_CURRENCYSUBUNIT,
ScanCode::KeypadLeftParen => bind::SDL_SCANCODE_KP_LEFTPAREN,
ScanCode::KeypadRightParen => bind::SDL_SCANCODE_KP_RIGHTPAREN,
ScanCode::KeypadLeftBrace => bind::SDL_SCANCODE_KP_LEFTBRACE,
ScanCode::KeypadRightBrace => bind::SDL_SCANCODE_KP_RIGHTBRACE,
ScanCode::KeypadTab => bind::SDL_SCANCODE_KP_TAB,
ScanCode::KeypadBackspace => bind::SDL_SCANCODE_KP_BACKSPACE,
ScanCode::KeypadA => bind::SDL_SCANCODE_KP_A,
ScanCode::KeypadB => bind::SDL_SCANCODE_KP_B,
ScanCode::KeypadC => bind::SDL_SCANCODE_KP_C,
ScanCode::KeypadD => bind::SDL_SCANCODE_KP_D,
ScanCode::KeypadE => bind::SDL_SCANCODE_KP_E,
ScanCode::KeypadF => bind::SDL_SCANCODE_KP_F,
ScanCode::KeypadXor => bind::SDL_SCANCODE_KP_XOR,
ScanCode::KeypadPower => bind::SDL_SCANCODE_KP_POWER,
ScanCode::KeypadPercent => bind::SDL_SCANCODE_KP_PERCENT,
ScanCode::KeypadLess => bind::SDL_SCANCODE_KP_LESS,
ScanCode::KeypadGreater => bind::SDL_SCANCODE_KP_GREATER,
ScanCode::KeypadAmpersand => bind::SDL_SCANCODE_KP_AMPERSAND,
ScanCode::KeypadDblAmpersand => bind::SDL_SCANCODE_KP_DBLAMPERSAND,
ScanCode::KeypadVerticalBar => bind::SDL_SCANCODE_KP_VERTICALBAR,
ScanCode::KeypadDblVerticalBar => bind::SDL_SCANCODE_KP_DBLVERTICALBAR,
ScanCode::KeypadColon => bind::SDL_SCANCODE_KP_COLON,
ScanCode::KeypadHash => bind::SDL_SCANCODE_KP_HASH,
ScanCode::KeypadSpace => bind::SDL_SCANCODE_KP_SPACE,
ScanCode::KeypadAt => bind::SDL_SCANCODE_KP_AT,
ScanCode::KeypadExclam => bind::SDL_SCANCODE_KP_EXCLAM,
ScanCode::KeypadMemStore => bind::SDL_SCANCODE_KP_MEMSTORE,
ScanCode::KeypadMemRecall => bind::SDL_SCANCODE_KP_MEMRECALL,
ScanCode::KeypadMemClear => bind::SDL_SCANCODE_KP_MEMCLEAR,
ScanCode::KeypadMemAdd => bind::SDL_SCANCODE_KP_MEMADD,
ScanCode::KeypadMemSubtract => bind::SDL_SCANCODE_KP_MEMSUBTRACT,
ScanCode::KeypadMemMultiply => bind::SDL_SCANCODE_KP_MEMMULTIPLY,
ScanCode::KeypadMemDivide => bind::SDL_SCANCODE_KP_MEMDIVIDE,
ScanCode::KeypadPlusMinus => bind::SDL_SCANCODE_KP_PLUSMINUS,
ScanCode::KeypadClear => bind::SDL_SCANCODE_KP_CLEAR,
ScanCode::KeypadClearEntry => bind::SDL_SCANCODE_KP_CLEARENTRY,
ScanCode::KeypadBinary => bind::SDL_SCANCODE_KP_BINARY,
ScanCode::KeypadOctal => bind::SDL_SCANCODE_KP_OCTAL,
ScanCode::KeypadDecimal => bind::SDL_SCANCODE_KP_DECIMAL,
ScanCode::KeypadHexadecimal => bind::SDL_SCANCODE_KP_HEXADECIMAL,
ScanCode::LCtrl => bind::SDL_SCANCODE_LCTRL,
ScanCode::LShift => bind::SDL_SCANCODE_LSHIFT,
ScanCode::LAlt => bind::SDL_SCANCODE_LALT,
ScanCode::LGui => bind::SDL_SCANCODE_LGUI,
ScanCode::RCtrl => bind::SDL_SCANCODE_RCTRL,
ScanCode::RShift => bind::SDL_SCANCODE_RSHIFT,
ScanCode::RAlt => bind::SDL_SCANCODE_RALT,
ScanCode::RGui => bind::SDL_SCANCODE_RGUI,
ScanCode::Mode => bind::SDL_SCANCODE_MODE,
ScanCode::AudioNext => bind::SDL_SCANCODE_AUDIONEXT,
ScanCode::AudioPrev => bind::SDL_SCANCODE_AUDIOPREV,
ScanCode::AudioStop => bind::SDL_SCANCODE_AUDIOSTOP,
ScanCode::AudioPlay => bind::SDL_SCANCODE_AUDIOPLAY,
ScanCode::AudioMute => bind::SDL_SCANCODE_AUDIOMUTE,
ScanCode::MediaSelect => bind::SDL_SCANCODE_MEDIASELECT,
ScanCode::Www => bind::SDL_SCANCODE_WWW,
ScanCode::Mail => bind::SDL_SCANCODE_MAIL,
ScanCode::Calculator => bind::SDL_SCANCODE_CALCULATOR,
ScanCode::Computer => bind::SDL_SCANCODE_COMPUTER,
ScanCode::ApplicationSearch => bind::SDL_SCANCODE_AC_SEARCH,
ScanCode::ApplicationHome => bind::SDL_SCANCODE_AC_HOME,
ScanCode::ApplicationBack => bind::SDL_SCANCODE_AC_BACK,
ScanCode::ApplicationForward => bind::SDL_SCANCODE_AC_FORWARD,
ScanCode::ApplicationStop => bind::SDL_SCANCODE_AC_STOP,
ScanCode::ApplicationRefresh => bind::SDL_SCANCODE_AC_REFRESH,
ScanCode::ApplicationBookmarks => bind::SDL_SCANCODE_AC_BOOKMARKS,
ScanCode::BrightnessDown => bind::SDL_SCANCODE_BRIGHTNESSDOWN,
ScanCode::BrightnessUp => bind::SDL_SCANCODE_BRIGHTNESSUP,
ScanCode::DisplaySwitch => bind::SDL_SCANCODE_DISPLAYSWITCH,
ScanCode::KeyboardIllumToggle => bind::SDL_SCANCODE_KBDILLUMTOGGLE,
ScanCode::KeyboardIllumDown => bind::SDL_SCANCODE_KBDILLUMDOWN,
ScanCode::KeyboardIllumUp => bind::SDL_SCANCODE_KBDILLUMUP,
ScanCode::Eject => bind::SDL_SCANCODE_EJECT,
ScanCode::Sleep => bind::SDL_SCANCODE_SLEEP,
ScanCode::App1 => bind::SDL_SCANCODE_APP1,
ScanCode::App2 => bind::SDL_SCANCODE_APP2,
ScanCode::AudioRewind => bind::SDL_SCANCODE_AUDIOREWIND,
ScanCode::AudioFastForward => bind::SDL_SCANCODE_AUDIOFASTFORWARD,
}
}
}
impl From<KeyCode> for ScanCode {
fn from(key_code: KeyCode) -> Self {
unsafe { bind::SDL_GetScancodeFromKey(key_code.as_raw()) }.into()
}
}
impl From<bind::SDL_Scancode> for ScanCode {
fn from(code: bind::SDL_Scancode) -> Self {
match code {
bind::SDL_SCANCODE_A => ScanCode::A,
bind::SDL_SCANCODE_B => ScanCode::B,
bind::SDL_SCANCODE_C => ScanCode::C,
bind::SDL_SCANCODE_D => ScanCode::D,
bind::SDL_SCANCODE_E => ScanCode::E,
bind::SDL_SCANCODE_F => ScanCode::F,
bind::SDL_SCANCODE_G => ScanCode::G,
bind::SDL_SCANCODE_H => ScanCode::H,
bind::SDL_SCANCODE_I => ScanCode::I,
bind::SDL_SCANCODE_J => ScanCode::J,
bind::SDL_SCANCODE_K => ScanCode::K,
bind::SDL_SCANCODE_L => ScanCode::L,
bind::SDL_SCANCODE_M => ScanCode::M,
bind::SDL_SCANCODE_N => ScanCode::N,
bind::SDL_SCANCODE_O => ScanCode::O,
bind::SDL_SCANCODE_P => ScanCode::P,
bind::SDL_SCANCODE_Q => ScanCode::Q,
bind::SDL_SCANCODE_R => ScanCode::R,
bind::SDL_SCANCODE_S => ScanCode::S,
bind::SDL_SCANCODE_T => ScanCode::T,
bind::SDL_SCANCODE_U => ScanCode::U,
bind::SDL_SCANCODE_V => ScanCode::V,
bind::SDL_SCANCODE_W => ScanCode::W,
bind::SDL_SCANCODE_X => ScanCode::X,
bind::SDL_SCANCODE_Y => ScanCode::Y,
bind::SDL_SCANCODE_Z => ScanCode::Z,
bind::SDL_SCANCODE_1 => ScanCode::Num1,
bind::SDL_SCANCODE_2 => ScanCode::Num2,
bind::SDL_SCANCODE_3 => ScanCode::Num3,
bind::SDL_SCANCODE_4 => ScanCode::Num4,
bind::SDL_SCANCODE_5 => ScanCode::Num5,
bind::SDL_SCANCODE_6 => ScanCode::Num6,
bind::SDL_SCANCODE_7 => ScanCode::Num7,
bind::SDL_SCANCODE_8 => ScanCode::Num8,
bind::SDL_SCANCODE_9 => ScanCode::Num9,
bind::SDL_SCANCODE_0 => ScanCode::Num0,
bind::SDL_SCANCODE_RETURN => ScanCode::Return,
bind::SDL_SCANCODE_ESCAPE => ScanCode::Escape,
bind::SDL_SCANCODE_BACKSPACE => ScanCode::Backspace,
bind::SDL_SCANCODE_TAB => ScanCode::Tab,
bind::SDL_SCANCODE_SPACE => ScanCode::Space,
bind::SDL_SCANCODE_MINUS => ScanCode::Minus,
bind::SDL_SCANCODE_EQUALS => ScanCode::Equals,
bind::SDL_SCANCODE_LEFTBRACKET => ScanCode::LeftBracket,
bind::SDL_SCANCODE_RIGHTBRACKET => ScanCode::RightBracket,
bind::SDL_SCANCODE_BACKSLASH => ScanCode::Backslash,
bind::SDL_SCANCODE_NONUSHASH => ScanCode::NonUsHash,
bind::SDL_SCANCODE_SEMICOLON => ScanCode::Semicolon,
bind::SDL_SCANCODE_APOSTROPHE => ScanCode::Apostrophe,
bind::SDL_SCANCODE_GRAVE => ScanCode::Grave,
bind::SDL_SCANCODE_COMMA => ScanCode::Comma,
bind::SDL_SCANCODE_PERIOD => ScanCode::Period,
bind::SDL_SCANCODE_SLASH => ScanCode::Slash,
bind::SDL_SCANCODE_CAPSLOCK => ScanCode::CapsLock,
bind::SDL_SCANCODE_F1 => ScanCode::F1,
bind::SDL_SCANCODE_F2 => ScanCode::F2,
bind::SDL_SCANCODE_F3 => ScanCode::F3,
bind::SDL_SCANCODE_F4 => ScanCode::F4,
bind::SDL_SCANCODE_F5 => ScanCode::F5,
bind::SDL_SCANCODE_F6 => ScanCode::F6,
bind::SDL_SCANCODE_F7 => ScanCode::F7,
bind::SDL_SCANCODE_F8 => ScanCode::F8,
bind::SDL_SCANCODE_F9 => ScanCode::F9,
bind::SDL_SCANCODE_F10 => ScanCode::F10,
bind::SDL_SCANCODE_F11 => ScanCode::F11,
bind::SDL_SCANCODE_F12 => ScanCode::F12,
bind::SDL_SCANCODE_PRINTSCREEN => ScanCode::PrintScreen,
bind::SDL_SCANCODE_SCROLLLOCK => ScanCode::ScrollLock,
bind::SDL_SCANCODE_PAUSE => ScanCode::Pause,
bind::SDL_SCANCODE_INSERT => ScanCode::Insert,
bind::SDL_SCANCODE_HOME => ScanCode::Home,
bind::SDL_SCANCODE_PAGEUP => ScanCode::PageUp,
bind::SDL_SCANCODE_DELETE => ScanCode::Delete,
bind::SDL_SCANCODE_END => ScanCode::End,
bind::SDL_SCANCODE_PAGEDOWN => ScanCode::PageDown,
bind::SDL_SCANCODE_RIGHT => ScanCode::Right,
bind::SDL_SCANCODE_LEFT => ScanCode::Left,
bind::SDL_SCANCODE_DOWN => ScanCode::Down,
bind::SDL_SCANCODE_UP => ScanCode::Up,
bind::SDL_SCANCODE_NUMLOCKCLEAR => ScanCode::NumLockClear,
bind::SDL_SCANCODE_KP_DIVIDE => ScanCode::KeypadDivide,
bind::SDL_SCANCODE_KP_MULTIPLY => ScanCode::KeypadMultiply,
bind::SDL_SCANCODE_KP_MINUS => ScanCode::KeypadMinus,
bind::SDL_SCANCODE_KP_PLUS => ScanCode::KeypadPlus,
bind::SDL_SCANCODE_KP_ENTER => ScanCode::KeypadEnter,
bind::SDL_SCANCODE_KP_1 => ScanCode::Keypad1,
bind::SDL_SCANCODE_KP_2 => ScanCode::Keypad2,
bind::SDL_SCANCODE_KP_3 => ScanCode::Keypad3,
bind::SDL_SCANCODE_KP_4 => ScanCode::Keypad4,
bind::SDL_SCANCODE_KP_5 => ScanCode::Keypad5,
bind::SDL_SCANCODE_KP_6 => ScanCode::Keypad6,
bind::SDL_SCANCODE_KP_7 => ScanCode::Keypad7,
bind::SDL_SCANCODE_KP_8 => ScanCode::Keypad8,
bind::SDL_SCANCODE_KP_9 => ScanCode::Keypad9,
bind::SDL_SCANCODE_KP_0 => ScanCode::Keypad0,
bind::SDL_SCANCODE_KP_PERIOD => ScanCode::KeypadPeriod,
bind::SDL_SCANCODE_NONUSBACKSLASH => ScanCode::NonUsBackslash,
bind::SDL_SCANCODE_APPLICATION => ScanCode::Application,
bind::SDL_SCANCODE_POWER => ScanCode::Power,
bind::SDL_SCANCODE_KP_EQUALS => ScanCode::KeypadEquals,
bind::SDL_SCANCODE_F13 => ScanCode::F13,
bind::SDL_SCANCODE_F14 => ScanCode::F14,
bind::SDL_SCANCODE_F15 => ScanCode::F15,
bind::SDL_SCANCODE_F16 => ScanCode::F16,
bind::SDL_SCANCODE_F17 => ScanCode::F17,
bind::SDL_SCANCODE_F18 => ScanCode::F18,
bind::SDL_SCANCODE_F19 => ScanCode::F19,
bind::SDL_SCANCODE_F20 => ScanCode::F20,
bind::SDL_SCANCODE_F21 => ScanCode::F21,
bind::SDL_SCANCODE_F22 => ScanCode::F22,
bind::SDL_SCANCODE_F23 => ScanCode::F23,
bind::SDL_SCANCODE_F24 => ScanCode::F24,
bind::SDL_SCANCODE_EXECUTE => ScanCode::Execute,
bind::SDL_SCANCODE_HELP => ScanCode::Help,
bind::SDL_SCANCODE_MENU => ScanCode::Menu,
bind::SDL_SCANCODE_SELECT => ScanCode::Select,
bind::SDL_SCANCODE_STOP => ScanCode::Stop,
bind::SDL_SCANCODE_AGAIN => ScanCode::Again,
bind::SDL_SCANCODE_UNDO => ScanCode::Undo,
bind::SDL_SCANCODE_CUT => ScanCode::Cut,
bind::SDL_SCANCODE_COPY => ScanCode::Copy,
bind::SDL_SCANCODE_PASTE => ScanCode::Paste,
bind::SDL_SCANCODE_FIND => ScanCode::Find,
bind::SDL_SCANCODE_MUTE => ScanCode::Mute,
bind::SDL_SCANCODE_VOLUMEUP => ScanCode::VolumeUp,
bind::SDL_SCANCODE_VOLUMEDOWN => ScanCode::VolumeDown,
bind::SDL_SCANCODE_KP_COMMA => ScanCode::KeypadComma,
bind::SDL_SCANCODE_KP_EQUALSAS400 => ScanCode::KeypadEqualsAs400,
bind::SDL_SCANCODE_INTERNATIONAL1 => ScanCode::International1,
bind::SDL_SCANCODE_INTERNATIONAL2 => ScanCode::International2,
bind::SDL_SCANCODE_INTERNATIONAL3 => ScanCode::International3,
bind::SDL_SCANCODE_INTERNATIONAL4 => ScanCode::International4,
bind::SDL_SCANCODE_INTERNATIONAL5 => ScanCode::International5,
bind::SDL_SCANCODE_INTERNATIONAL6 => ScanCode::International6,
bind::SDL_SCANCODE_INTERNATIONAL7 => ScanCode::International7,
bind::SDL_SCANCODE_INTERNATIONAL8 => ScanCode::International8,
bind::SDL_SCANCODE_INTERNATIONAL9 => ScanCode::International9,
bind::SDL_SCANCODE_LANG1 => ScanCode::Lang1,
bind::SDL_SCANCODE_LANG2 => ScanCode::Lang2,
bind::SDL_SCANCODE_LANG3 => ScanCode::Lang3,
bind::SDL_SCANCODE_LANG4 => ScanCode::Lang4,
bind::SDL_SCANCODE_LANG5 => ScanCode::Lang5,
bind::SDL_SCANCODE_LANG6 => ScanCode::Lang6,
bind::SDL_SCANCODE_LANG7 => ScanCode::Lang7,
bind::SDL_SCANCODE_LANG8 => ScanCode::Lang8,
bind::SDL_SCANCODE_LANG9 => ScanCode::Lang9,
bind::SDL_SCANCODE_ALTERASE => ScanCode::AltErase,
bind::SDL_SCANCODE_SYSREQ => ScanCode::SysReq,
bind::SDL_SCANCODE_CANCEL => ScanCode::Cancel,
bind::SDL_SCANCODE_CLEAR => ScanCode::Clear,
bind::SDL_SCANCODE_PRIOR => ScanCode::Prior,
bind::SDL_SCANCODE_RETURN2 => ScanCode::Return2,
bind::SDL_SCANCODE_SEPARATOR => ScanCode::Separator,
bind::SDL_SCANCODE_OUT => ScanCode::Out,
bind::SDL_SCANCODE_OPER => ScanCode::Oper,
bind::SDL_SCANCODE_CLEARAGAIN => ScanCode::ClearAgain,
bind::SDL_SCANCODE_CRSEL => ScanCode::CrSel,
bind::SDL_SCANCODE_EXSEL => ScanCode::ExSel,
bind::SDL_SCANCODE_KP_00 => ScanCode::Keypad00,
bind::SDL_SCANCODE_KP_000 => ScanCode::Keypad000,
bind::SDL_SCANCODE_THOUSANDSSEPARATOR => ScanCode::ThousandsSeparator,
bind::SDL_SCANCODE_DECIMALSEPARATOR => ScanCode::DecimalSeparator,
bind::SDL_SCANCODE_CURRENCYUNIT => ScanCode::CurrencyUnit,
bind::SDL_SCANCODE_CURRENCYSUBUNIT => ScanCode::CurrencySubunit,
bind::SDL_SCANCODE_KP_LEFTPAREN => ScanCode::KeypadLeftParen,
bind::SDL_SCANCODE_KP_RIGHTPAREN => ScanCode::KeypadRightParen,
bind::SDL_SCANCODE_KP_LEFTBRACE => ScanCode::KeypadLeftBrace,
bind::SDL_SCANCODE_KP_RIGHTBRACE => ScanCode::KeypadRightBrace,
bind::SDL_SCANCODE_KP_TAB => ScanCode::KeypadTab,
bind::SDL_SCANCODE_KP_BACKSPACE => ScanCode::KeypadBackspace,
bind::SDL_SCANCODE_KP_A => ScanCode::KeypadA,
bind::SDL_SCANCODE_KP_B => ScanCode::KeypadB,
bind::SDL_SCANCODE_KP_C => ScanCode::KeypadC,
bind::SDL_SCANCODE_KP_D => ScanCode::KeypadD,
bind::SDL_SCANCODE_KP_E => ScanCode::KeypadE,
bind::SDL_SCANCODE_KP_F => ScanCode::KeypadF,
bind::SDL_SCANCODE_KP_XOR => ScanCode::KeypadXor,
bind::SDL_SCANCODE_KP_POWER => ScanCode::KeypadPower,
bind::SDL_SCANCODE_KP_PERCENT => ScanCode::KeypadPercent,
bind::SDL_SCANCODE_KP_LESS => ScanCode::KeypadLess,
bind::SDL_SCANCODE_KP_GREATER => ScanCode::KeypadGreater,
bind::SDL_SCANCODE_KP_AMPERSAND => ScanCode::KeypadAmpersand,
bind::SDL_SCANCODE_KP_DBLAMPERSAND => ScanCode::KeypadDblAmpersand,
bind::SDL_SCANCODE_KP_VERTICALBAR => ScanCode::KeypadVerticalBar,
bind::SDL_SCANCODE_KP_DBLVERTICALBAR => ScanCode::KeypadDblVerticalBar,
bind::SDL_SCANCODE_KP_COLON => ScanCode::KeypadColon,
bind::SDL_SCANCODE_KP_HASH => ScanCode::KeypadHash,
bind::SDL_SCANCODE_KP_SPACE => ScanCode::KeypadSpace,
bind::SDL_SCANCODE_KP_AT => ScanCode::KeypadAt,
bind::SDL_SCANCODE_KP_EXCLAM => ScanCode::KeypadExclam,
bind::SDL_SCANCODE_KP_MEMSTORE => ScanCode::KeypadMemStore,
bind::SDL_SCANCODE_KP_MEMRECALL => ScanCode::KeypadMemRecall,
bind::SDL_SCANCODE_KP_MEMCLEAR => ScanCode::KeypadMemClear,
bind::SDL_SCANCODE_KP_MEMADD => ScanCode::KeypadMemAdd,
bind::SDL_SCANCODE_KP_MEMSUBTRACT => ScanCode::KeypadMemSubtract,
bind::SDL_SCANCODE_KP_MEMMULTIPLY => ScanCode::KeypadMemMultiply,
bind::SDL_SCANCODE_KP_MEMDIVIDE => ScanCode::KeypadMemDivide,
bind::SDL_SCANCODE_KP_PLUSMINUS => ScanCode::KeypadPlusMinus,
bind::SDL_SCANCODE_KP_CLEAR => ScanCode::KeypadClear,
bind::SDL_SCANCODE_KP_CLEARENTRY => ScanCode::KeypadClearEntry,
bind::SDL_SCANCODE_KP_BINARY => ScanCode::KeypadBinary,
bind::SDL_SCANCODE_KP_OCTAL => ScanCode::KeypadOctal,
bind::SDL_SCANCODE_KP_DECIMAL => ScanCode::KeypadDecimal,
bind::SDL_SCANCODE_KP_HEXADECIMAL => ScanCode::KeypadHexadecimal,
bind::SDL_SCANCODE_LCTRL => ScanCode::LCtrl,
bind::SDL_SCANCODE_LSHIFT => ScanCode::LShift,
bind::SDL_SCANCODE_LALT => ScanCode::LAlt,
bind::SDL_SCANCODE_LGUI => ScanCode::LGui,
bind::SDL_SCANCODE_RCTRL => ScanCode::RCtrl,
bind::SDL_SCANCODE_RSHIFT => ScanCode::RShift,
bind::SDL_SCANCODE_RALT => ScanCode::RAlt,
bind::SDL_SCANCODE_RGUI => ScanCode::RGui,
bind::SDL_SCANCODE_MODE => ScanCode::Mode,
bind::SDL_SCANCODE_AUDIONEXT => ScanCode::AudioNext,
bind::SDL_SCANCODE_AUDIOPREV => ScanCode::AudioPrev,
bind::SDL_SCANCODE_AUDIOSTOP => ScanCode::AudioStop,
bind::SDL_SCANCODE_AUDIOPLAY => ScanCode::AudioPlay,
bind::SDL_SCANCODE_AUDIOMUTE => ScanCode::AudioMute,
bind::SDL_SCANCODE_MEDIASELECT => ScanCode::MediaSelect,
bind::SDL_SCANCODE_WWW => ScanCode::Www,
bind::SDL_SCANCODE_MAIL => ScanCode::Mail,
bind::SDL_SCANCODE_CALCULATOR => ScanCode::Calculator,
bind::SDL_SCANCODE_COMPUTER => ScanCode::Computer,
bind::SDL_SCANCODE_AC_SEARCH => ScanCode::ApplicationSearch,
bind::SDL_SCANCODE_AC_HOME => ScanCode::ApplicationHome,
bind::SDL_SCANCODE_AC_BACK => ScanCode::ApplicationBack,
bind::SDL_SCANCODE_AC_FORWARD => ScanCode::ApplicationForward,
bind::SDL_SCANCODE_AC_STOP => ScanCode::ApplicationStop,
bind::SDL_SCANCODE_AC_REFRESH => ScanCode::ApplicationRefresh,
bind::SDL_SCANCODE_AC_BOOKMARKS => ScanCode::ApplicationBookmarks,
bind::SDL_SCANCODE_BRIGHTNESSDOWN => ScanCode::BrightnessDown,
bind::SDL_SCANCODE_BRIGHTNESSUP => ScanCode::BrightnessUp,
bind::SDL_SCANCODE_DISPLAYSWITCH => ScanCode::DisplaySwitch,
bind::SDL_SCANCODE_KBDILLUMTOGGLE => ScanCode::KeyboardIllumToggle,
bind::SDL_SCANCODE_KBDILLUMDOWN => ScanCode::KeyboardIllumDown,
bind::SDL_SCANCODE_KBDILLUMUP => ScanCode::KeyboardIllumUp,
bind::SDL_SCANCODE_EJECT => ScanCode::Eject,
bind::SDL_SCANCODE_SLEEP => ScanCode::Sleep,
bind::SDL_SCANCODE_APP1 => ScanCode::App1,
bind::SDL_SCANCODE_APP2 => ScanCode::App2,
bind::SDL_SCANCODE_AUDIOREWIND => ScanCode::AudioRewind,
bind::SDL_SCANCODE_AUDIOFASTFORWARD => ScanCode::AudioFastForward,
_ => ScanCode::Unknown,
}
}
}