SDL: Changed SDL_KeyCode values to defines

From 70ce808c090fdaf5d98ce3fc8273bcb115427de1 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 15 Apr 2024 13:48:14 -0700
Subject: [PATCH] Changed SDL_KeyCode values to defines

This clears up confusion about whether to use SDL_KeyCode or SDL_Keycode and makes it clear that the values aren't the full set of possible keycodes.

Fixes https://github.com/libsdl-org/SDL/issues/9493
---
 docs/README-migration.md   |   2 +-
 include/SDL3/SDL_keycode.h | 532 +++++++++++++++++--------------------
 2 files changed, 246 insertions(+), 288 deletions(-)

diff --git a/docs/README-migration.md b/docs/README-migration.md
index 38a7399882cc1..046345ee8c7a8 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -875,7 +875,7 @@ The following functions have been removed:
 
 ## SDL_keycode.h
 
-SDL_Keycode is now an enum instead of Sint32.
+The SDL_KeyCode enum values have been changed to defines to more clearly reflect that they are a subset of the possible values of an SDL_Keycode.
 
 The following symbols have been renamed:
 * KMOD_ALT => SDL_KMOD_ALT
diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h
index a43deaea13136..d04d86c8bc527 100644
--- a/include/SDL3/SDL_keycode.h
+++ b/include/SDL3/SDL_keycode.h
@@ -42,9 +42,6 @@
  * A special exception is the number keys at the top of the keyboard which map
  * to SDLK_0...SDLK_9 on AZERTY layouts.
  *
- * The list of `SDLK_*` values are in SDL_KeyCode, which is an enum, while
- * SDL_Keycode is an integer.
- *
  * \since This datatype is available since SDL 3.0.0.
  *
  * \sa SDL_KeyCode
@@ -55,291 +52,252 @@ typedef Sint32 SDL_Keycode;
 #define SDL_SCANCODE_TO_KEYCODE(X)  (X | SDLK_SCANCODE_MASK)
 
 /**
- * Possible SDL virtual key values.
- *
- * Values from this enum are used to represent keyboard keys using the current
- * layout of the keyboard.
- *
- * \since This enum is available since SDL 3.0.0.
+ * A subset of possible virtual key values.
  */
-typedef enum SDL_KeyCode
-{
-    SDLK_UNKNOWN = 0,
-
-    SDLK_RETURN = '\r',
-    SDLK_ESCAPE = '\x1B',
-    SDLK_BACKSPACE = '\b',
-    SDLK_TAB = '\t',
-    SDLK_SPACE = ' ',
-    SDLK_EXCLAIM = '!',
-    SDLK_QUOTEDBL = '"',
-    SDLK_HASH = '#',
-    SDLK_PERCENT = '%',
-    SDLK_DOLLAR = '$',
-    SDLK_AMPERSAND = '&',
-    SDLK_QUOTE = '\'',
-    SDLK_LEFTPAREN = '(',
-    SDLK_RIGHTPAREN = ')',
-    SDLK_ASTERISK = '*',
-    SDLK_PLUS = '+',
-    SDLK_COMMA = ',',
-    SDLK_MINUS = '-',
-    SDLK_PERIOD = '.',
-    SDLK_SLASH = '/',
-    SDLK_0 = '0',
-    SDLK_1 = '1',
-    SDLK_2 = '2',
-    SDLK_3 = '3',
-    SDLK_4 = '4',
-    SDLK_5 = '5',
-    SDLK_6 = '6',
-    SDLK_7 = '7',
-    SDLK_8 = '8',
-    SDLK_9 = '9',
-    SDLK_COLON = ':',
-    SDLK_SEMICOLON = ';',
-    SDLK_LESS = '<',
-    SDLK_EQUALS = '=',
-    SDLK_GREATER = '>',
-    SDLK_QUESTION = '?',
-    SDLK_AT = '@',
-
-    /*
-       Skip uppercase letters
-     */
-
-    SDLK_LEFTBRACKET = '[',
-    SDLK_BACKSLASH = '\\',
-    SDLK_RIGHTBRACKET = ']',
-    SDLK_CARET = '^',
-    SDLK_UNDERSCORE = '_',
-    SDLK_BACKQUOTE = '`',
-    SDLK_a = 'a',
-    SDLK_b = 'b',
-    SDLK_c = 'c',
-    SDLK_d = 'd',
-    SDLK_e = 'e',
-    SDLK_f = 'f',
-    SDLK_g = 'g',
-    SDLK_h = 'h',
-    SDLK_i = 'i',
-    SDLK_j = 'j',
-    SDLK_k = 'k',
-    SDLK_l = 'l',
-    SDLK_m = 'm',
-    SDLK_n = 'n',
-    SDLK_o = 'o',
-    SDLK_p = 'p',
-    SDLK_q = 'q',
-    SDLK_r = 'r',
-    SDLK_s = 's',
-    SDLK_t = 't',
-    SDLK_u = 'u',
-    SDLK_v = 'v',
-    SDLK_w = 'w',
-    SDLK_x = 'x',
-    SDLK_y = 'y',
-    SDLK_z = 'z',
-
-    SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK),
-
-    SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
-    SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
-    SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
-    SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
-    SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
-    SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
-    SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
-    SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
-    SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
-    SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
-    SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
-    SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12),
-
-    SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN),
-    SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK),
-    SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE),
-    SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
-    SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
-    SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
-    SDLK_DELETE = '\x7F',
-    SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
-    SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
-    SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
-    SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
-    SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
-    SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
-
-    SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR),
-    SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE),
-    SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY),
-    SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS),
-    SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS),
-    SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER),
-    SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1),
-    SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2),
-    SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3),
-    SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4),
-    SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5),
-    SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6),
-    SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7),
-    SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8),
-    SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9),
-    SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0),
-    SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD),
-
-    SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION),
-    SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER),
-    SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS),
-    SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13),
-    SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14),
-    SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15),
-    SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16),
-    SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17),
-    SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18),
-    SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19),
-    SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20),
-    SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21),
-    SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22),
-    SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23),
-    SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24),
-    SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE),
-    SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP),
-    SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU),
-    SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT),
-    SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP),
-    SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN),
-    SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO),
-    SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT),
-    SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY),
-    SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE),
-    SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND),
-    SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE),
-    SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP),
-    SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN),
-    SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA),
-    SDLK_KP_EQUALSAS400 =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400),
-
-    SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE),
-    SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ),
-    SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL),
-    SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR),
-    SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR),
-    SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2),
-    SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR),
-    SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT),
-    SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER),
-    SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN),
-    SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL),
-    SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL),
-
-    SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00),
-    SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000),
-    SDLK_THOUSANDSSEPARATOR =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR),
-    SDLK_DECIMALSEPARATOR =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR),
-    SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT),
-    SDLK_CURRENCYSUBUNIT =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT),
-    SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN),
-    SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN),
-    SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE),
-    SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE),
-    SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB),
-    SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE),
-    SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A),
-    SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B),
-    SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C),
-    SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D),
-    SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E),
-    SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F),
-    SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR),
-    SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER),
-    SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT),
-    SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS),
-    SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER),
-    SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND),
-    SDLK_KP_DBLAMPERSAND =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND),
-    SDLK_KP_VERTICALBAR =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR),
-    SDLK_KP_DBLVERTICALBAR =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR),
-    SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON),
-    SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH),
-    SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE),
-    SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT),
-    SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM),
-    SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE),
-    SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL),
-    SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR),
-    SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD),
-    SDLK_KP_MEMSUBTRACT =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT),
-    SDLK_KP_MEMMULTIPLY =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY),
-    SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE),
-    SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS),
-    SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR),
-    SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY),
-    SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY),
-    SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL),
-    SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL),
-    SDLK_KP_HEXADECIMAL =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL),
-
-    SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL),
-    SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT),
-    SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT),
-    SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI),
-    SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL),
-    SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT),
-    SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT),
-    SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI),
-
-    SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE),
-
-    SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT),
-    SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV),
-    SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP),
-    SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY),
-    SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE),
-    SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT),
-    SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW),
-    SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL),
-    SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR),
-    SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER),
-    SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH),
-    SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME),
-    SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK),
-    SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD),
-    SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP),
-    SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH),
-    SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS),
-
-    SDLK_BRIGHTNESSDOWN =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN),
-    SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP),
-    SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH),
-    SDLK_KBDILLUMTOGGLE =
-        SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE),
-    SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
-    SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
-    SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
-    SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP),
-    SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1),
-    SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
-
-    SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
-    SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD),
-
-    SDLK_SOFTLEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT),
-    SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT),
-    SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL),
-    SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL)
-} SDL_KeyCode;
+#define SDLK_UNKNOWN    0
+#define SDLK_RETURN '\r'
+#define SDLK_ESCAPE '\x1B'
+#define SDLK_BACKSPACE  '\b'
+#define SDLK_TAB    '\t'
+#define SDLK_SPACE  ' '
+#define SDLK_EXCLAIM    '!'
+#define SDLK_QUOTEDBL   '"'
+#define SDLK_HASH   '#'
+#define SDLK_PERCENT    '%'
+#define SDLK_DOLLAR '$'
+#define SDLK_AMPERSAND  '&'
+#define SDLK_QUOTE  '\''
+#define SDLK_LEFTPAREN  '('
+#define SDLK_RIGHTPAREN ')'
+#define SDLK_ASTERISK   '*'
+#define SDLK_PLUS   '+'
+#define SDLK_COMMA  ','
+#define SDLK_MINUS  '-'
+#define SDLK_PERIOD '.'
+#define SDLK_SLASH  '/'
+#define SDLK_0  '0'
+#define SDLK_1  '1'
+#define SDLK_2  '2'
+#define SDLK_3  '3'
+#define SDLK_4  '4'
+#define SDLK_5  '5'
+#define SDLK_6  '6'
+#define SDLK_7  '7'
+#define SDLK_8  '8'
+#define SDLK_9  '9'
+#define SDLK_COLON  ':'
+#define SDLK_SEMICOLON  ';'
+#define SDLK_LESS   '<'
+#define SDLK_EQUALS '='
+#define SDLK_GREATER    '>'
+#define SDLK_QUESTION   '?'
+#define SDLK_AT '@'
+#define SDLK_LEFTBRACKET    '['
+#define SDLK_BACKSLASH  '\\'
+#define SDLK_RIGHTBRACKET   ']'
+#define SDLK_CARET  '^'
+#define SDLK_UNDERSCORE '_'
+#define SDLK_BACKQUOTE  '`'
+#define SDLK_a  'a'
+#define SDLK_b  'b'
+#define SDLK_c  'c'
+#define SDLK_d  'd'
+#define SDLK_e  'e'
+#define SDLK_f  'f'
+#define SDLK_g  'g'
+#define SDLK_h  'h'
+#define SDLK_i  'i'
+#define SDLK_j  'j'
+#define SDLK_k  'k'
+#define SDLK_l  'l'
+#define SDLK_m  'm'
+#define SDLK_n  'n'
+#define SDLK_o  'o'
+#define SDLK_p  'p'
+#define SDLK_q  'q'
+#define SDLK_r  'r'
+#define SDLK_s  's'
+#define SDLK_t  't'
+#define SDLK_u  'u'
+#define SDLK_v  'v'
+#define SDLK_w  'w'
+#define SDLK_x  'x'
+#define SDLK_y  'y'
+#define SDLK_z  'z'
+#define SDLK_CAPSLOCK   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK)
+#define SDLK_F1 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1)
+#define SDLK_F2 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2)
+#define SDLK_F3 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3)
+#define SDLK_F4 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4)
+#define SDLK_F5 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5)
+#define SDLK_F6 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6)
+#define SDLK_F7 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7)
+#define SDLK_F8 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8)
+#define SDLK_F9 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9)
+#define SDLK_F10    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10)
+#define SDLK_F11    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11)
+#define SDLK_F12    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12)
+#define SDLK_PRINTSCREEN    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN)
+#define SDLK_SCROLLLOCK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK)
+#define SDLK_PAUSE  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE)
+#define SDLK_INSERT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT)
+#define SDLK_HOME   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME)
+#define SDLK_PAGEUP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP)
+#define SDLK_DELETE '\x7F'
+#define SDLK_END    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END)
+#define SDLK_PAGEDOWN   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN)
+#define SDLK_RIGHT  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT)
+#define SDLK_LEFT   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT)
+#define SDLK_DOWN   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN)
+#define SDLK_UP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP)
+#define SDLK_NUMLOCKCLEAR   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR)
+#define SDLK_KP_DIVIDE  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE)
+#define SDLK_KP_MULTIPLY    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY)
+#define SDLK_KP_MINUS   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS)
+#define SDLK_KP_PLUS    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS)
+#define SDLK_KP_ENTER   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER)
+#define SDLK_KP_1   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1)
+#define SDLK_KP_2   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2)
+#define SDLK_KP_3   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3)
+#define SDLK_KP_4   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4)
+#define SDLK_KP_5   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5)
+#define SDLK_KP_6   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6)
+#define SDLK_KP_7   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7)
+#define SDLK_KP_8   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8)
+#define SDLK_KP_9   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9)
+#define SDLK_KP_0   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0)
+#define SDLK_KP_PERIOD  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD)
+#define SDLK_APPLICATION    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION)
+#define SDLK_POWER  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER)
+#define SDLK_KP_EQUALS  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS)
+#define SDLK_F13    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13)
+#define SDLK_F14    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14)
+#define SDLK_F15    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15)
+#define SDLK_F16    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16)
+#define SDLK_F17    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17)
+#define SDLK_F18    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18)
+#define SDLK_F19    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19)
+#define SDLK_F20    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20)
+#define SDLK_F21    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21)
+#define SDLK_F22    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22)
+#define SDLK_F23    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23)
+#define SDLK_F24    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24)
+#define SDLK_EXECUTE    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE)
+#define SDLK_HELP   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP)
+#define SDLK_MENU   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU)
+#define SDLK_SELECT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT)
+#define SDLK_STOP   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP)
+#define SDLK_AGAIN  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN)
+#define SDLK_UNDO   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO)
+#define SDLK_CUT    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT)
+#define SDLK_COPY   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY)
+#define SDLK_PASTE  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE)
+#define SDLK_FIND   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND)
+#define SDLK_MUTE   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE)
+#define SDLK_VOLUMEUP   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP)
+#define SDLK_VOLUMEDOWN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN)
+#define SDLK_KP_COMMA   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA)
+#define SDLK_KP_EQUALSAS400 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400)
+#define SDLK_ALTERASE   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE)
+#define SDLK_SYSREQ SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ)
+#define SDLK_CANCEL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL)
+#define SDLK_CLEAR  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR)
+#define SDLK_PRIOR  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR)
+#define SDLK_RETURN2    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2)
+#define SDLK_SEPARATOR  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR)
+#define SDLK_OUT    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT)
+#define SDLK_OPER   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER)
+#define SDLK_CLEARAGAIN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN)
+#define SDLK_CRSEL  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL)
+#define SDLK_EXSEL  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL)
+#define SDLK_KP_00  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00)
+#define SDLK_KP_000 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000)
+#define SDLK_THOUSANDSSEPARATOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR)
+#define SDLK_DECIMALSEPARATOR   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR)
+#define SDLK_CURRENCYUNIT   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT)
+#define SDLK_CURRENCYSUBUNIT    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT)
+#define SDLK_KP_LEFTPAREN   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN)
+#define SDLK_KP_RIGHTPAREN  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN)
+#define SDLK_KP_LEFTBRACE   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE)
+#define SDLK_KP_RIGHTBRACE  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE)
+#define SDLK_KP_TAB SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB)
+#define SDLK_KP_BACKSPACE   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE)
+#define SDLK_KP_A   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A)
+#define SDLK_KP_B   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B)
+#define SDLK_KP_C   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C)
+#define SDLK_KP_D   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D)
+#define SDLK_KP_E   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E)
+#define SDLK_KP_F   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F)
+#define SDLK_KP_XOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR)
+#define SDLK_KP_POWER   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER)
+#define SDLK_KP_PERCENT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT)
+#define SDLK_KP_LESS    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS)
+#define SDLK_KP_GREATER SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER)
+#define SDLK_KP_AMPERSAND   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND)
+#define SDLK_KP_DBLAMPERSAND    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND)
+#define SDLK_KP_VERTICALBAR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR)
+#define SDLK_KP_DBLVERTICALBAR  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR)
+#define SDLK_KP_COLON   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON)
+#define SDLK_KP_HASH    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH)
+#define SDLK_KP_SPACE   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE)
+#define SDLK_KP_AT  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT)
+#define SDLK_KP_EXCLAM  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM)
+#define SDLK_KP_MEMSTORE    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE)
+#define SDLK_KP_MEMRECALL   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL)
+#define SDLK_KP_MEMCLEAR    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR)
+#define SDLK_KP_MEMADD  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD)
+#define SDLK_KP_MEMSUBTRACT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT)
+#define SDLK_KP_MEMMULTIPLY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY)
+#define SDLK_KP_MEMDIVIDE   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE)
+#define SDLK_KP_PLUSMINUS   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS)
+#define SDLK_KP_CLEAR   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR)
+#define SDLK_KP_CLEARENTRY  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY)
+#define SDLK_KP_BINARY  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY)
+#define SDLK_KP_OCTAL   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL)
+#define SDLK_KP_DECIMAL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL)
+#define SDLK_KP_HEXADECIMAL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL)
+#define SDLK_LCTRL  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL)
+#define SDLK_LSHIFT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT)
+#define SDLK_LALT   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT)
+#define SDLK_LGUI   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI)
+#define SDLK_RCTRL  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL)
+#define SDLK_RSHIFT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT)
+#define SDLK_RALT   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT)
+#define SDLK_RGUI   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI)
+#define SDLK_MODE   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE)
+#define SDLK_AUDIONEXT  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT)
+#define SDLK_AUDIOPREV  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV)
+#define SDLK_AUDIOSTOP  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP)
+#define SDLK_AUDIOPLAY  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY)
+#define SDLK_AUDIOMUTE  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE)
+#define SDLK_MEDIASELECT    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT)
+#define SDLK_WWW    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW)
+#define SDLK_MAIL   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL)
+#define SDLK_CALCULATOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR)
+#define SDLK_COMPUTER   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER)
+#define SDLK_AC_SEARCH  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH)
+#define SDLK_AC_HOME    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME)
+#define SDLK_AC_BACK    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK)
+#define SDLK_AC_FORWARD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD)
+#define SDLK_AC_STOP    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP)
+#define SDLK_AC_REFRESH SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH)
+#define SDLK_AC_BOOKMARKS   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS)
+#define SDLK_BRIGHTNESSDOWN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN)
+#define SDLK_BRIGHTNESSUP   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP)
+#define SDLK_DISPLAYSWITCH  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH)
+#define SDLK_KBDILLUMTOGGLE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE)
+#define SDLK_KBDILLUMDOWN   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN)
+#define SDLK_KBDILLUMUP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP)
+#define SDLK_EJECT  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT)
+#define SDLK_SLEEP  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP)
+#define SDLK_APP1   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1)
+#define SDLK_APP2   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2)
+#define SDLK_AUDIOREWIND    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND)
+#define SDLK_AUDIOFASTFORWARD   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
+#define SDLK_SOFTLEFT   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT)
+#define SDLK_SOFTRIGHT  SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT)
+#define SDLK_CALL   SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL)
+#define SDLK_ENDCALL    SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL)
 
 /**
  * Enumeration of valid key mods (possibly OR'd together).