Reformat Win32 scan code table

main
Dimitriy Ryazantcev 2023-11-27 14:27:51 +02:00 committed by Sam Lantinga
parent 7e86b6aef2
commit 6b28065e9e
1 changed files with 130 additions and 27 deletions

View File

@ -24,32 +24,135 @@
/* derived from Microsoft scan code document, http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc */
/* *INDENT-OFF* */ /* clang-format off */
static const SDL_Scancode windows_scancode_table[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, SDL_SCANCODE_5, SDL_SCANCODE_6, /* 0 */
SDL_SCANCODE_7, SDL_SCANCODE_8, SDL_SCANCODE_9, SDL_SCANCODE_0, SDL_SCANCODE_MINUS, SDL_SCANCODE_EQUALS, SDL_SCANCODE_BACKSPACE, SDL_SCANCODE_TAB, /* 0 */
SDL_SCANCODE_Q, SDL_SCANCODE_W, SDL_SCANCODE_E, SDL_SCANCODE_R, SDL_SCANCODE_T, SDL_SCANCODE_Y, SDL_SCANCODE_U, SDL_SCANCODE_I, /* 1 */
SDL_SCANCODE_O, SDL_SCANCODE_P, SDL_SCANCODE_LEFTBRACKET, SDL_SCANCODE_RIGHTBRACKET, SDL_SCANCODE_RETURN, SDL_SCANCODE_LCTRL, SDL_SCANCODE_A, SDL_SCANCODE_S, /* 1 */
SDL_SCANCODE_D, SDL_SCANCODE_F, SDL_SCANCODE_G, SDL_SCANCODE_H, SDL_SCANCODE_J, SDL_SCANCODE_K, SDL_SCANCODE_L, SDL_SCANCODE_SEMICOLON, /* 2 */
SDL_SCANCODE_APOSTROPHE, SDL_SCANCODE_GRAVE, SDL_SCANCODE_LSHIFT, SDL_SCANCODE_BACKSLASH, SDL_SCANCODE_Z, SDL_SCANCODE_X, SDL_SCANCODE_C, SDL_SCANCODE_V, /* 2 */
SDL_SCANCODE_B, SDL_SCANCODE_N, SDL_SCANCODE_M, SDL_SCANCODE_COMMA, SDL_SCANCODE_PERIOD, SDL_SCANCODE_SLASH, SDL_SCANCODE_RSHIFT, SDL_SCANCODE_PRINTSCREEN,/* 3 */
SDL_SCANCODE_LALT, SDL_SCANCODE_SPACE, SDL_SCANCODE_CAPSLOCK, SDL_SCANCODE_F1, SDL_SCANCODE_F2, SDL_SCANCODE_F3, SDL_SCANCODE_F4, SDL_SCANCODE_F5, /* 3 */
SDL_SCANCODE_F6, SDL_SCANCODE_F7, SDL_SCANCODE_F8, SDL_SCANCODE_F9, SDL_SCANCODE_F10, SDL_SCANCODE_NUMLOCKCLEAR, SDL_SCANCODE_SCROLLLOCK, SDL_SCANCODE_HOME, /* 4 */
SDL_SCANCODE_UP, SDL_SCANCODE_PAGEUP, SDL_SCANCODE_KP_MINUS, SDL_SCANCODE_LEFT, SDL_SCANCODE_KP_5, SDL_SCANCODE_RIGHT, SDL_SCANCODE_KP_PLUS, SDL_SCANCODE_END, /* 4 */
SDL_SCANCODE_DOWN, SDL_SCANCODE_PAGEDOWN, SDL_SCANCODE_INSERT, SDL_SCANCODE_DELETE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_NONUSBACKSLASH,SDL_SCANCODE_F11, /* 5 */
SDL_SCANCODE_F12, SDL_SCANCODE_PAUSE, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_LGUI, SDL_SCANCODE_RGUI, SDL_SCANCODE_APPLICATION, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 5 */
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_F13, SDL_SCANCODE_F14, SDL_SCANCODE_F15, SDL_SCANCODE_F16, /* 6 */
SDL_SCANCODE_F17, SDL_SCANCODE_F18, SDL_SCANCODE_F19, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 6 */
SDL_SCANCODE_INTERNATIONAL2, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL1, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN, /* 7 */
SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL4, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL5, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_INTERNATIONAL3, SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_UNKNOWN /* 7 */
static const SDL_Scancode windows_scancode_table[] =
{
/*0x00*/ SDL_SCANCODE_UNKNOWN,
/*0x01*/ SDL_SCANCODE_ESCAPE,
/*0x02*/ SDL_SCANCODE_1,
/*0x03*/ SDL_SCANCODE_2,
/*0x04*/ SDL_SCANCODE_3,
/*0x05*/ SDL_SCANCODE_4,
/*0x06*/ SDL_SCANCODE_5,
/*0x07*/ SDL_SCANCODE_6,
/*0x08*/ SDL_SCANCODE_7,
/*0x09*/ SDL_SCANCODE_8,
/*0x0a*/ SDL_SCANCODE_9,
/*0x0b*/ SDL_SCANCODE_0,
/*0x0c*/ SDL_SCANCODE_MINUS,
/*0x0d*/ SDL_SCANCODE_EQUALS,
/*0x0e*/ SDL_SCANCODE_BACKSPACE,
/*0x0f*/ SDL_SCANCODE_TAB,
/*0x10*/ SDL_SCANCODE_Q,
/*0x11*/ SDL_SCANCODE_W,
/*0x12*/ SDL_SCANCODE_E,
/*0x13*/ SDL_SCANCODE_R,
/*0x14*/ SDL_SCANCODE_T,
/*0x15*/ SDL_SCANCODE_Y,
/*0x16*/ SDL_SCANCODE_U,
/*0x17*/ SDL_SCANCODE_I,
/*0x18*/ SDL_SCANCODE_O,
/*0x19*/ SDL_SCANCODE_P,
/*0x1a*/ SDL_SCANCODE_LEFTBRACKET,
/*0x1b*/ SDL_SCANCODE_RIGHTBRACKET,
/*0x1c*/ SDL_SCANCODE_RETURN,
/*0x1d*/ SDL_SCANCODE_LCTRL,
/*0x1e*/ SDL_SCANCODE_A,
/*0x1f*/ SDL_SCANCODE_S,
/*0x20*/ SDL_SCANCODE_D,
/*0x21*/ SDL_SCANCODE_F,
/*0x22*/ SDL_SCANCODE_G,
/*0x23*/ SDL_SCANCODE_H,
/*0x24*/ SDL_SCANCODE_J,
/*0x25*/ SDL_SCANCODE_K,
/*0x26*/ SDL_SCANCODE_L,
/*0x27*/ SDL_SCANCODE_SEMICOLON,
/*0x28*/ SDL_SCANCODE_APOSTROPHE,
/*0x29*/ SDL_SCANCODE_GRAVE,
/*0x2a*/ SDL_SCANCODE_LSHIFT,
/*0x2b*/ SDL_SCANCODE_BACKSLASH,
/*0x2c*/ SDL_SCANCODE_Z,
/*0x2d*/ SDL_SCANCODE_X,
/*0x2e*/ SDL_SCANCODE_C,
/*0x2f*/ SDL_SCANCODE_V,
/*0x30*/ SDL_SCANCODE_B,
/*0x31*/ SDL_SCANCODE_N,
/*0x32*/ SDL_SCANCODE_M,
/*0x33*/ SDL_SCANCODE_COMMA,
/*0x34*/ SDL_SCANCODE_PERIOD,
/*0x35*/ SDL_SCANCODE_SLASH,
/*0x36*/ SDL_SCANCODE_RSHIFT,
/*0x37*/ SDL_SCANCODE_PRINTSCREEN,
/*0x38*/ SDL_SCANCODE_LALT,
/*0x39*/ SDL_SCANCODE_SPACE,
/*0x3a*/ SDL_SCANCODE_CAPSLOCK,
/*0x3b*/ SDL_SCANCODE_F1,
/*0x3c*/ SDL_SCANCODE_F2,
/*0x3d*/ SDL_SCANCODE_F3,
/*0x3e*/ SDL_SCANCODE_F4,
/*0x3f*/ SDL_SCANCODE_F5,
/*0x40*/ SDL_SCANCODE_F6,
/*0x41*/ SDL_SCANCODE_F7,
/*0x42*/ SDL_SCANCODE_F8,
/*0x43*/ SDL_SCANCODE_F9,
/*0x44*/ SDL_SCANCODE_F10,
/*0x45*/ SDL_SCANCODE_NUMLOCKCLEAR,
/*0x46*/ SDL_SCANCODE_SCROLLLOCK,
/*0x47*/ SDL_SCANCODE_HOME,
/*0x48*/ SDL_SCANCODE_UP,
/*0x49*/ SDL_SCANCODE_PAGEUP,
/*0x4a*/ SDL_SCANCODE_KP_MINUS,
/*0x4b*/ SDL_SCANCODE_LEFT,
/*0x4c*/ SDL_SCANCODE_KP_5,
/*0x4d*/ SDL_SCANCODE_RIGHT,
/*0x4e*/ SDL_SCANCODE_KP_PLUS,
/*0x4f*/ SDL_SCANCODE_END,
/*0x50*/ SDL_SCANCODE_DOWN,
/*0x51*/ SDL_SCANCODE_PAGEDOWN,
/*0x52*/ SDL_SCANCODE_INSERT,
/*0x53*/ SDL_SCANCODE_DELETE,
/*0x54*/ SDL_SCANCODE_UNKNOWN,
/*0x55*/ SDL_SCANCODE_UNKNOWN,
/*0x56*/ SDL_SCANCODE_NONUSBACKSLASH,
/*0x57*/ SDL_SCANCODE_F11,
/*0x58*/ SDL_SCANCODE_F12,
/*0x59*/ SDL_SCANCODE_PAUSE,
/*0x5a*/ SDL_SCANCODE_UNKNOWN,
/*0x5b*/ SDL_SCANCODE_LGUI,
/*0x5c*/ SDL_SCANCODE_RGUI,
/*0x5d*/ SDL_SCANCODE_APPLICATION,
/*0x5e*/ SDL_SCANCODE_UNKNOWN,
/*0x5f*/ SDL_SCANCODE_UNKNOWN,
/*0x60*/ SDL_SCANCODE_UNKNOWN,
/*0x61*/ SDL_SCANCODE_UNKNOWN,
/*0x62*/ SDL_SCANCODE_UNKNOWN,
/*0x63*/ SDL_SCANCODE_UNKNOWN,
/*0x64*/ SDL_SCANCODE_F13,
/*0x65*/ SDL_SCANCODE_F14,
/*0x66*/ SDL_SCANCODE_F15,
/*0x67*/ SDL_SCANCODE_F16,
/*0x68*/ SDL_SCANCODE_F17,
/*0x69*/ SDL_SCANCODE_F18,
/*0x6a*/ SDL_SCANCODE_F19,
/*0x6b*/ SDL_SCANCODE_UNKNOWN,
/*0x6c*/ SDL_SCANCODE_UNKNOWN,
/*0x6d*/ SDL_SCANCODE_UNKNOWN,
/*0x6e*/ SDL_SCANCODE_UNKNOWN,
/*0x6f*/ SDL_SCANCODE_UNKNOWN,
/*0x70*/ SDL_SCANCODE_INTERNATIONAL2,
/*0x71*/ SDL_SCANCODE_UNKNOWN,
/*0x72*/ SDL_SCANCODE_UNKNOWN,
/*0x73*/ SDL_SCANCODE_INTERNATIONAL1,
/*0x74*/ SDL_SCANCODE_UNKNOWN,
/*0x75*/ SDL_SCANCODE_UNKNOWN,
/*0x76*/ SDL_SCANCODE_UNKNOWN,
/*0x77*/ SDL_SCANCODE_UNKNOWN,
/*0x78*/ SDL_SCANCODE_UNKNOWN,
/*0x79*/ SDL_SCANCODE_INTERNATIONAL4,
/*0x7a*/ SDL_SCANCODE_UNKNOWN,
/*0x7b*/ SDL_SCANCODE_INTERNATIONAL5,
/*0x7c*/ SDL_SCANCODE_UNKNOWN,
/*0x7d*/ SDL_SCANCODE_INTERNATIONAL3,
/*0x7e*/ SDL_SCANCODE_UNKNOWN,
/*0x7f*/ SDL_SCANCODE_UNKNOWN
};
/* *INDENT-ON* */ /* clang-format on */