src/events/scancodes_xfree86.h
author Sam Lantinga <slouken@libsdl.org>
Thu, 20 Jul 2017 10:46:38 -0700
changeset 11149 504c67e71589
parent 10737 3406a0f8b041
child 11811 5d94cb6b24d3
permissions -rw-r--r--
Fixed bug 3703 - Missing media keys support on Amazon Fire TV remote control

Holger Schemel

Summary: This patch adds support for key events for the "rewind" and "fast forward" media keys on the Amazon Fire TV remote control.

How to reproduce the problem: Run Android build of SDL2 application on the Amazon Fire TV (tested with "stick" version) and log key events.

Expected behaviour: Every key pressed on the Fire TV remote control should result in a corresponding key event (pressed/released).

Observed behaviour: Of the bottom row of buttons on the Fire TV remote control, only the "play/pause" (middle) button generates a key event, while the "rewind" (left) and "fast forward" (right) buttons to not generate any event at all.

The attached patch adds support for these two missing buttons/keys.

Note 1: Some missing definitions were added for the already existing key codes SDL_SCANCODE_APP1 and SDL_SCANCODE_APP2 (to keep up the correct order of enumerations / array positions when adding the two new key codes).

Note 2: Definitions in "scancodes_linux.h" and "scancodes_xfree86.h" (to also add support for these keys on other platforms) were added without testing. However, I was unable to find corresponding definitions for these two media keys for Windows and Mac OS X.

Note 3: I have also updated the (broken) link to the USB usage page standard PDF document (comment in "include/SDL_scancode.h").
     1 /*
     2   Simple DirectMedia Layer
     3   Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
     4 
     5   This software is provided 'as-is', without any express or implied
     6   warranty.  In no event will the authors be held liable for any damages
     7   arising from the use of this software.
     8 
     9   Permission is granted to anyone to use this software for any purpose,
    10   including commercial applications, and to alter it and redistribute it
    11   freely, subject to the following restrictions:
    12 
    13   1. The origin of this software must not be misrepresented; you must not
    14      claim that you wrote the original software. If you use this software
    15      in a product, an acknowledgment in the product documentation would be
    16      appreciated but is not required.
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    21 #include "../../include/SDL_scancode.h"
    22 
    23 /* XFree86 key code to SDL scancode mapping table
    24    Sources:
    25    - atKeyNames.h from XFree86 source code
    26 */
    27 /* *INDENT-OFF* */
    28 static const SDL_Scancode xfree86_scancode_table[] = {
    29     /*  0 */    SDL_SCANCODE_UNKNOWN,
    30     /*  1 */    SDL_SCANCODE_ESCAPE,
    31     /*  2 */    SDL_SCANCODE_1,
    32     /*  3 */    SDL_SCANCODE_2,
    33     /*  4 */    SDL_SCANCODE_3,
    34     /*  5 */    SDL_SCANCODE_4,
    35     /*  6 */    SDL_SCANCODE_5,
    36     /*  7 */    SDL_SCANCODE_6,
    37     /*  8 */    SDL_SCANCODE_7,
    38     /*  9 */    SDL_SCANCODE_8,
    39     /*  10 */   SDL_SCANCODE_9,
    40     /*  11 */   SDL_SCANCODE_0,
    41     /*  12 */   SDL_SCANCODE_MINUS,
    42     /*  13 */   SDL_SCANCODE_EQUALS,
    43     /*  14 */   SDL_SCANCODE_BACKSPACE,
    44     /*  15 */   SDL_SCANCODE_TAB,
    45     /*  16 */   SDL_SCANCODE_Q,
    46     /*  17 */   SDL_SCANCODE_W,
    47     /*  18 */   SDL_SCANCODE_E,
    48     /*  19 */   SDL_SCANCODE_R,
    49     /*  20 */   SDL_SCANCODE_T,
    50     /*  21 */   SDL_SCANCODE_Y,
    51     /*  22 */   SDL_SCANCODE_U,
    52     /*  23 */   SDL_SCANCODE_I,
    53     /*  24 */   SDL_SCANCODE_O,
    54     /*  25 */   SDL_SCANCODE_P,
    55     /*  26 */   SDL_SCANCODE_LEFTBRACKET,
    56     /*  27 */   SDL_SCANCODE_RIGHTBRACKET,
    57     /*  28 */   SDL_SCANCODE_RETURN,
    58     /*  29 */   SDL_SCANCODE_LCTRL,
    59     /*  30 */   SDL_SCANCODE_A,
    60     /*  31 */   SDL_SCANCODE_S,
    61     /*  32 */   SDL_SCANCODE_D,
    62     /*  33 */   SDL_SCANCODE_F,
    63     /*  34 */   SDL_SCANCODE_G,
    64     /*  35 */   SDL_SCANCODE_H,
    65     /*  36 */   SDL_SCANCODE_J,
    66     /*  37 */   SDL_SCANCODE_K,
    67     /*  38 */   SDL_SCANCODE_L,
    68     /*  39 */   SDL_SCANCODE_SEMICOLON,
    69     /*  40 */   SDL_SCANCODE_APOSTROPHE,
    70     /*  41 */   SDL_SCANCODE_GRAVE,
    71     /*  42 */   SDL_SCANCODE_LSHIFT,
    72     /*  43 */   SDL_SCANCODE_BACKSLASH,
    73     /*  44 */   SDL_SCANCODE_Z,
    74     /*  45 */   SDL_SCANCODE_X,
    75     /*  46 */   SDL_SCANCODE_C,
    76     /*  47 */   SDL_SCANCODE_V,
    77     /*  48 */   SDL_SCANCODE_B,
    78     /*  49 */   SDL_SCANCODE_N,
    79     /*  50 */   SDL_SCANCODE_M,
    80     /*  51 */   SDL_SCANCODE_COMMA,
    81     /*  52 */   SDL_SCANCODE_PERIOD,
    82     /*  53 */   SDL_SCANCODE_SLASH,
    83     /*  54 */   SDL_SCANCODE_RSHIFT,
    84     /*  55 */   SDL_SCANCODE_KP_MULTIPLY,
    85     /*  56 */   SDL_SCANCODE_LALT,
    86     /*  57 */   SDL_SCANCODE_SPACE,
    87     /*  58 */   SDL_SCANCODE_CAPSLOCK,
    88     /*  59 */   SDL_SCANCODE_F1,
    89     /*  60 */   SDL_SCANCODE_F2,
    90     /*  61 */   SDL_SCANCODE_F3,
    91     /*  62 */   SDL_SCANCODE_F4,
    92     /*  63 */   SDL_SCANCODE_F5,
    93     /*  64 */   SDL_SCANCODE_F6,
    94     /*  65 */   SDL_SCANCODE_F7,
    95     /*  66 */   SDL_SCANCODE_F8,
    96     /*  67 */   SDL_SCANCODE_F9,
    97     /*  68 */   SDL_SCANCODE_F10,
    98     /*  69 */   SDL_SCANCODE_NUMLOCKCLEAR,
    99     /*  70 */   SDL_SCANCODE_SCROLLLOCK,
   100     /*  71 */   SDL_SCANCODE_KP_7,
   101     /*  72 */   SDL_SCANCODE_KP_8,
   102     /*  73 */   SDL_SCANCODE_KP_9,
   103     /*  74 */   SDL_SCANCODE_KP_MINUS,
   104     /*  75 */   SDL_SCANCODE_KP_4,
   105     /*  76 */   SDL_SCANCODE_KP_5,
   106     /*  77 */   SDL_SCANCODE_KP_6,
   107     /*  78 */   SDL_SCANCODE_KP_PLUS,
   108     /*  79 */   SDL_SCANCODE_KP_1,
   109     /*  80 */   SDL_SCANCODE_KP_2,
   110     /*  81 */   SDL_SCANCODE_KP_3,
   111     /*  82 */   SDL_SCANCODE_KP_0,
   112     /*  83 */   SDL_SCANCODE_KP_PERIOD,
   113     /*  84 */   SDL_SCANCODE_SYSREQ,
   114     /*  85 */   SDL_SCANCODE_MODE,
   115     /*  86 */   SDL_SCANCODE_NONUSBACKSLASH,
   116     /*  87 */   SDL_SCANCODE_F11,
   117     /*  88 */   SDL_SCANCODE_F12,
   118     /*  89 */   SDL_SCANCODE_HOME,
   119     /*  90 */   SDL_SCANCODE_UP,
   120     /*  91 */   SDL_SCANCODE_PAGEUP,
   121     /*  92 */   SDL_SCANCODE_LEFT,
   122     /*  93 */   SDL_SCANCODE_BRIGHTNESSDOWN, /* on PowerBook G4 / KEY_Begin */
   123     /*  94 */   SDL_SCANCODE_RIGHT,
   124     /*  95 */   SDL_SCANCODE_END,
   125     /*  96 */   SDL_SCANCODE_DOWN,
   126     /*  97 */   SDL_SCANCODE_PAGEDOWN,
   127     /*  98 */   SDL_SCANCODE_INSERT,
   128     /*  99 */   SDL_SCANCODE_DELETE,
   129     /*  100 */  SDL_SCANCODE_KP_ENTER,
   130     /*  101 */  SDL_SCANCODE_RCTRL,
   131     /*  102 */  SDL_SCANCODE_PAUSE,
   132     /*  103 */  SDL_SCANCODE_PRINTSCREEN,
   133     /*  104 */  SDL_SCANCODE_KP_DIVIDE,
   134     /*  105 */  SDL_SCANCODE_RALT,
   135     /*  106 */  SDL_SCANCODE_UNKNOWN, /* BREAK */
   136     /*  107 */  SDL_SCANCODE_LGUI,
   137     /*  108 */  SDL_SCANCODE_RGUI,
   138     /*  109 */  SDL_SCANCODE_APPLICATION,
   139     /*  110 */  SDL_SCANCODE_F13,
   140     /*  111 */  SDL_SCANCODE_F14,
   141     /*  112 */  SDL_SCANCODE_F15,
   142     /*  113 */  SDL_SCANCODE_F16,
   143     /*  114 */  SDL_SCANCODE_F17,
   144     /*  115 */  SDL_SCANCODE_INTERNATIONAL1, /* \_ */
   145     /*  116 */  SDL_SCANCODE_UNKNOWN, /* is translated to XK_ISO_Level3_Shift by my X server, but I have no keyboard that generates this code, so I don't know what the correct SDL_SCANCODE_* for it is */
   146     /*  117 */  SDL_SCANCODE_UNKNOWN,
   147     /*  118 */  SDL_SCANCODE_KP_EQUALS,
   148     /*  119 */  SDL_SCANCODE_UNKNOWN,
   149     /*  120 */  SDL_SCANCODE_UNKNOWN,
   150     /*  121 */  SDL_SCANCODE_INTERNATIONAL4, /* Henkan_Mode */
   151     /*  122 */  SDL_SCANCODE_UNKNOWN,
   152     /*  123 */  SDL_SCANCODE_INTERNATIONAL5, /* Muhenkan */
   153     /*  124 */  SDL_SCANCODE_UNKNOWN,
   154     /*  125 */  SDL_SCANCODE_INTERNATIONAL3, /* Yen */
   155     /*  126 */  SDL_SCANCODE_UNKNOWN,
   156     /*  127 */  SDL_SCANCODE_UNKNOWN,
   157     /*  128 */  SDL_SCANCODE_UNKNOWN,
   158     /*  129 */  SDL_SCANCODE_UNKNOWN,
   159     /*  130 */  SDL_SCANCODE_UNKNOWN,
   160     /*  131 */  SDL_SCANCODE_UNKNOWN,
   161     /*  132 */  SDL_SCANCODE_POWER,
   162     /*  133 */  SDL_SCANCODE_MUTE,
   163     /*  134 */  SDL_SCANCODE_VOLUMEDOWN,
   164     /*  135 */  SDL_SCANCODE_VOLUMEUP,
   165     /*  136 */  SDL_SCANCODE_HELP,
   166     /*  137 */  SDL_SCANCODE_STOP,
   167     /*  138 */  SDL_SCANCODE_AGAIN,
   168     /*  139 */  SDL_SCANCODE_UNKNOWN, /* PROPS */
   169     /*  140 */  SDL_SCANCODE_UNDO,
   170     /*  141 */  SDL_SCANCODE_UNKNOWN, /* FRONT */
   171     /*  142 */  SDL_SCANCODE_COPY,
   172     /*  143 */  SDL_SCANCODE_UNKNOWN, /* OPEN */
   173     /*  144 */  SDL_SCANCODE_PASTE,
   174     /*  145 */  SDL_SCANCODE_FIND,
   175     /*  146 */  SDL_SCANCODE_CUT,
   176 };
   177 
   178 /* for wireless usb keyboard (manufacturer TRUST) without numpad. */
   179 static const SDL_Scancode xfree86_scancode_table2[] = {
   180     /*  0 */    SDL_SCANCODE_UNKNOWN,
   181     /*  1 */    SDL_SCANCODE_ESCAPE,
   182     /*  2 */    SDL_SCANCODE_1,
   183     /*  3 */    SDL_SCANCODE_2,
   184     /*  4 */    SDL_SCANCODE_3,
   185     /*  5 */    SDL_SCANCODE_4,
   186     /*  6 */    SDL_SCANCODE_5,
   187     /*  7 */    SDL_SCANCODE_6,
   188     /*  8 */    SDL_SCANCODE_7,
   189     /*  9 */    SDL_SCANCODE_8,
   190     /*  10 */   SDL_SCANCODE_9,
   191     /*  11 */   SDL_SCANCODE_0,
   192     /*  12 */   SDL_SCANCODE_MINUS,
   193     /*  13 */   SDL_SCANCODE_EQUALS,
   194     /*  14 */   SDL_SCANCODE_BACKSPACE,
   195     /*  15 */   SDL_SCANCODE_TAB,
   196     /*  16 */   SDL_SCANCODE_Q,
   197     /*  17 */   SDL_SCANCODE_W,
   198     /*  18 */   SDL_SCANCODE_E,
   199     /*  19 */   SDL_SCANCODE_R,
   200     /*  20 */   SDL_SCANCODE_T,
   201     /*  21 */   SDL_SCANCODE_Y,
   202     /*  22 */   SDL_SCANCODE_U,
   203     /*  23 */   SDL_SCANCODE_I,
   204     /*  24 */   SDL_SCANCODE_O,
   205     /*  25 */   SDL_SCANCODE_P,
   206     /*  26 */   SDL_SCANCODE_LEFTBRACKET,
   207     /*  27 */   SDL_SCANCODE_RIGHTBRACKET,
   208     /*  28 */   SDL_SCANCODE_RETURN,
   209     /*  29 */   SDL_SCANCODE_LCTRL,
   210     /*  30 */   SDL_SCANCODE_A,
   211     /*  31 */   SDL_SCANCODE_S,
   212     /*  32 */   SDL_SCANCODE_D,
   213     /*  33 */   SDL_SCANCODE_F,
   214     /*  34 */   SDL_SCANCODE_G,
   215     /*  35 */   SDL_SCANCODE_H,
   216     /*  36 */   SDL_SCANCODE_J,
   217     /*  37 */   SDL_SCANCODE_K,
   218     /*  38 */   SDL_SCANCODE_L,
   219     /*  39 */   SDL_SCANCODE_SEMICOLON,
   220     /*  40 */   SDL_SCANCODE_APOSTROPHE,
   221     /*  41 */   SDL_SCANCODE_GRAVE,
   222     /*  42 */   SDL_SCANCODE_LSHIFT,
   223     /*  43 */   SDL_SCANCODE_BACKSLASH,
   224     /*  44 */   SDL_SCANCODE_Z,
   225     /*  45 */   SDL_SCANCODE_X,
   226     /*  46 */   SDL_SCANCODE_C,
   227     /*  47 */   SDL_SCANCODE_V,
   228     /*  48 */   SDL_SCANCODE_B,
   229     /*  49 */   SDL_SCANCODE_N,
   230     /*  50 */   SDL_SCANCODE_M,
   231     /*  51 */   SDL_SCANCODE_COMMA,
   232     /*  52 */   SDL_SCANCODE_PERIOD,
   233     /*  53 */   SDL_SCANCODE_SLASH,
   234     /*  54 */   SDL_SCANCODE_RSHIFT,
   235     /*  55 */   SDL_SCANCODE_KP_MULTIPLY,
   236     /*  56 */   SDL_SCANCODE_LALT,
   237     /*  57 */   SDL_SCANCODE_SPACE,
   238     /*  58 */   SDL_SCANCODE_CAPSLOCK,
   239     /*  59 */   SDL_SCANCODE_F1,
   240     /*  60 */   SDL_SCANCODE_F2,
   241     /*  61 */   SDL_SCANCODE_F3,
   242     /*  62 */   SDL_SCANCODE_F4,
   243     /*  63 */   SDL_SCANCODE_F5,
   244     /*  64 */   SDL_SCANCODE_F6,
   245     /*  65 */   SDL_SCANCODE_F7,
   246     /*  66 */   SDL_SCANCODE_F8,
   247     /*  67 */   SDL_SCANCODE_F9,
   248     /*  68 */   SDL_SCANCODE_F10,
   249     /*  69 */   SDL_SCANCODE_NUMLOCKCLEAR,
   250     /*  70 */   SDL_SCANCODE_SCROLLLOCK,
   251     /*  71 */   SDL_SCANCODE_KP_7,
   252     /*  72 */   SDL_SCANCODE_KP_8,
   253     /*  73 */   SDL_SCANCODE_KP_9,
   254     /*  74 */   SDL_SCANCODE_KP_MINUS,
   255     /*  75 */   SDL_SCANCODE_KP_4,
   256     /*  76 */   SDL_SCANCODE_KP_5,
   257     /*  77 */   SDL_SCANCODE_KP_6,
   258     /*  78 */   SDL_SCANCODE_KP_PLUS,
   259     /*  79 */   SDL_SCANCODE_KP_1,
   260     /*  80 */   SDL_SCANCODE_KP_2,
   261     /*  81 */   SDL_SCANCODE_KP_3,
   262     /*  82 */   SDL_SCANCODE_KP_0,
   263     /*  83 */   SDL_SCANCODE_KP_PERIOD,
   264     /*  84 */   SDL_SCANCODE_SYSREQ,    /* ???? */
   265     /*  85 */   SDL_SCANCODE_MODE,      /* ???? */
   266     /*  86 */   SDL_SCANCODE_NONUSBACKSLASH,
   267     /*  87 */   SDL_SCANCODE_F11,
   268     /*  88 */   SDL_SCANCODE_F12,
   269     /*  89 */   SDL_SCANCODE_INTERNATIONAL1, /* \_ */
   270     /*  90 */   SDL_SCANCODE_UNKNOWN,   /* Katakana */
   271     /*  91 */   SDL_SCANCODE_UNKNOWN,   /* Hiragana */
   272     /*  92 */   SDL_SCANCODE_INTERNATIONAL4, /* Henkan_Mode */
   273     /*  93 */   SDL_SCANCODE_INTERNATIONAL2, /* Hiragana_Katakana */
   274     /*  94 */   SDL_SCANCODE_INTERNATIONAL5, /* Muhenkan */
   275     /*  95 */   SDL_SCANCODE_UNKNOWN,
   276     /*  96 */   SDL_SCANCODE_KP_ENTER,
   277     /*  97 */   SDL_SCANCODE_RCTRL,
   278     /*  98 */   SDL_SCANCODE_KP_DIVIDE,
   279     /*  99 */   SDL_SCANCODE_PRINTSCREEN,
   280     /* 100 */   SDL_SCANCODE_RALT,      /* ISO_Level3_Shift, ALTGR, RALT */
   281     /* 101 */   SDL_SCANCODE_UNKNOWN,   /* Linefeed */
   282     /* 102 */   SDL_SCANCODE_HOME,
   283     /* 103 */   SDL_SCANCODE_UP,
   284     /* 104 */   SDL_SCANCODE_PAGEUP,
   285     /* 105 */   SDL_SCANCODE_LEFT,
   286     /* 106 */   SDL_SCANCODE_RIGHT,
   287     /* 107 */   SDL_SCANCODE_END,
   288     /* 108 */   SDL_SCANCODE_DOWN,
   289     /* 109 */   SDL_SCANCODE_PAGEDOWN,
   290     /* 110 */   SDL_SCANCODE_INSERT,
   291     /* 111 */   SDL_SCANCODE_DELETE,
   292     /* 112 */   SDL_SCANCODE_UNKNOWN,
   293     /* 113 */   SDL_SCANCODE_MUTE,
   294     /* 114 */   SDL_SCANCODE_VOLUMEDOWN,
   295     /* 115 */   SDL_SCANCODE_VOLUMEUP,
   296     /* 116 */   SDL_SCANCODE_POWER,
   297     /* 117 */   SDL_SCANCODE_KP_EQUALS,
   298     /* 118 */   SDL_SCANCODE_UNKNOWN,   /* plusminus */
   299     /* 119 */   SDL_SCANCODE_PAUSE,
   300     /* 120 */   SDL_SCANCODE_UNKNOWN,   /* XF86LaunchA */
   301     /* 121 */   SDL_SCANCODE_UNKNOWN,   /* KP_Decimal */
   302     /* 122 */   SDL_SCANCODE_UNKNOWN,   /* Hangul */
   303     /* 123 */   SDL_SCANCODE_UNKNOWN,   /* Hangul_Hanja */
   304     /* 124 */   SDL_SCANCODE_INTERNATIONAL3, /* Yen */
   305     /* 125 */   SDL_SCANCODE_LGUI,
   306     /* 126 */   SDL_SCANCODE_RGUI,
   307     /* 127 */   SDL_SCANCODE_APPLICATION,
   308     /* 128 */   SDL_SCANCODE_CANCEL,
   309     /* 129 */   SDL_SCANCODE_AGAIN,
   310     /* 130 */   SDL_SCANCODE_UNKNOWN,   /* SunProps */
   311     /* 131 */   SDL_SCANCODE_UNDO,
   312     /* 132 */   SDL_SCANCODE_UNKNOWN,   /* SunFront */
   313     /* 133 */   SDL_SCANCODE_COPY,
   314     /* 134 */   SDL_SCANCODE_UNKNOWN,   /* SunOpen */
   315     /* 135 */   SDL_SCANCODE_PASTE,
   316     /* 136 */   SDL_SCANCODE_FIND,
   317     /* 137 */   SDL_SCANCODE_CUT,
   318     /* 138 */   SDL_SCANCODE_HELP,
   319     /* 139 */   SDL_SCANCODE_UNKNOWN,   /* XF86MenuKB */
   320     /* 140 */   SDL_SCANCODE_CALCULATOR,
   321     /* 141 */   SDL_SCANCODE_UNKNOWN,
   322     /* 142 */   SDL_SCANCODE_SLEEP,
   323     /* 143 */   SDL_SCANCODE_UNKNOWN,   /* XF86WakeUp */
   324     /* 144 */   SDL_SCANCODE_UNKNOWN,   /* XF86Explorer */
   325     /* 145 */   SDL_SCANCODE_UNKNOWN,   /* XF86Send */
   326     /* 146 */   SDL_SCANCODE_UNKNOWN,
   327     /* 147 */   SDL_SCANCODE_UNKNOWN,   /* XF86Xfer */
   328     /* 148 */   SDL_SCANCODE_APP1,      /* XF86Launch1 */
   329     /* 149 */   SDL_SCANCODE_APP2,      /* XF86Launch2 */
   330     /* 150 */   SDL_SCANCODE_WWW,
   331     /* 151 */   SDL_SCANCODE_UNKNOWN,   /* XF86DOS */
   332     /* 152 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScreenSaver */
   333     /* 153 */   SDL_SCANCODE_UNKNOWN,
   334     /* 154 */   SDL_SCANCODE_UNKNOWN,   /* XF86RotateWindows */
   335     /* 155 */   SDL_SCANCODE_MAIL,
   336     /* 156 */   SDL_SCANCODE_AC_BOOKMARKS,   /* XF86Favorites */
   337     /* 157 */   SDL_SCANCODE_COMPUTER,
   338     /* 158 */   SDL_SCANCODE_AC_BACK,
   339     /* 159 */   SDL_SCANCODE_AC_FORWARD,
   340     /* 160 */   SDL_SCANCODE_UNKNOWN,
   341     /* 161 */   SDL_SCANCODE_EJECT,
   342     /* 162 */   SDL_SCANCODE_EJECT,
   343     /* 163 */   SDL_SCANCODE_AUDIONEXT,
   344     /* 164 */   SDL_SCANCODE_AUDIOPLAY,
   345     /* 165 */   SDL_SCANCODE_AUDIOPREV,
   346     /* 166 */   SDL_SCANCODE_AUDIOSTOP,
   347     /* 167 */   SDL_SCANCODE_UNKNOWN,   /* XF86AudioRecord */
   348     /* 168 */   SDL_SCANCODE_AUDIOREWIND,   /* XF86AudioRewind */
   349     /* 169 */   SDL_SCANCODE_UNKNOWN,   /* XF86Phone */
   350     /* 170 */   SDL_SCANCODE_UNKNOWN,
   351     /* 171 */   SDL_SCANCODE_F13,       /* XF86Tools */
   352     /* 172 */   SDL_SCANCODE_AC_HOME,
   353     /* 173 */   SDL_SCANCODE_AC_REFRESH,
   354     /* 174 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
   355     /* 175 */   SDL_SCANCODE_UNKNOWN,
   356     /* 176 */   SDL_SCANCODE_UNKNOWN,
   357     /* 177 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollUp */
   358     /* 178 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollDown */
   359     /* 179 */   SDL_SCANCODE_UNKNOWN,   /* parenleft */
   360     /* 180 */   SDL_SCANCODE_UNKNOWN,   /* parenright */
   361     /* 181 */   SDL_SCANCODE_UNKNOWN,   /* XF86New */
   362     /* 182 */   SDL_SCANCODE_AGAIN,
   363     /* 183 */   SDL_SCANCODE_F13,       /* XF86Tools */
   364     /* 184 */   SDL_SCANCODE_F14,       /* XF86Launch5 */
   365     /* 185 */   SDL_SCANCODE_F15,       /* XF86Launch6 */
   366     /* 186 */   SDL_SCANCODE_F16,       /* XF86Launch7 */
   367     /* 187 */   SDL_SCANCODE_F17,       /* XF86Launch8 */
   368     /* 188 */   SDL_SCANCODE_F18,       /* XF86Launch9 */
   369     /* 189 */   SDL_SCANCODE_F19,       /* null keysym */
   370     /* 190 */   SDL_SCANCODE_UNKNOWN,
   371     /* 191 */   SDL_SCANCODE_UNKNOWN,
   372     /* 192 */   SDL_SCANCODE_UNKNOWN,   /* XF86TouchpadToggle */
   373     /* 193 */   SDL_SCANCODE_UNKNOWN,
   374     /* 194 */   SDL_SCANCODE_UNKNOWN,
   375     /* 195 */   SDL_SCANCODE_MODE,
   376     /* 196 */   SDL_SCANCODE_UNKNOWN,
   377     /* 197 */   SDL_SCANCODE_UNKNOWN,
   378     /* 198 */   SDL_SCANCODE_UNKNOWN,
   379     /* 199 */   SDL_SCANCODE_UNKNOWN,
   380     /* 200 */   SDL_SCANCODE_AUDIOPLAY,
   381     /* 201 */   SDL_SCANCODE_UNKNOWN,   /* XF86AudioPause */
   382     /* 202 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch3 */
   383     /* 203 */   SDL_SCANCODE_UNKNOWN,   /* XF86Launch4 */
   384     /* 204 */   SDL_SCANCODE_UNKNOWN,   /* XF86LaunchB */
   385     /* 205 */   SDL_SCANCODE_UNKNOWN,   /* XF86Suspend */
   386     /* 206 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
   387     /* 207 */   SDL_SCANCODE_AUDIOPLAY,
   388     /* 208 */   SDL_SCANCODE_AUDIONEXT,
   389     /* 209 */   SDL_SCANCODE_UNKNOWN,
   390     /* 210 */   SDL_SCANCODE_PRINTSCREEN,
   391     /* 211 */   SDL_SCANCODE_UNKNOWN,
   392     /* 212 */   SDL_SCANCODE_UNKNOWN,   /* XF86WebCam */
   393     /* 213 */   SDL_SCANCODE_UNKNOWN,
   394     /* 214 */   SDL_SCANCODE_UNKNOWN,
   395     /* 215 */   SDL_SCANCODE_MAIL,
   396     /* 216 */   SDL_SCANCODE_UNKNOWN,
   397     /* 217 */   SDL_SCANCODE_AC_SEARCH,
   398     /* 218 */   SDL_SCANCODE_UNKNOWN,
   399     /* 219 */   SDL_SCANCODE_UNKNOWN,   /* XF86Finance */
   400     /* 220 */   SDL_SCANCODE_UNKNOWN,
   401     /* 221 */   SDL_SCANCODE_UNKNOWN,   /* XF86Shop */
   402     /* 222 */   SDL_SCANCODE_UNKNOWN,
   403     /* 223 */   SDL_SCANCODE_STOP,
   404     /* 224 */   SDL_SCANCODE_BRIGHTNESSDOWN,
   405     /* 225 */   SDL_SCANCODE_BRIGHTNESSUP,
   406     /* 226 */   SDL_SCANCODE_MEDIASELECT,
   407     /* 227 */   SDL_SCANCODE_DISPLAYSWITCH,
   408     /* 228 */   SDL_SCANCODE_KBDILLUMTOGGLE,
   409     /* 229 */   SDL_SCANCODE_KBDILLUMDOWN,
   410     /* 230 */   SDL_SCANCODE_KBDILLUMUP,
   411     /* 231 */   SDL_SCANCODE_UNKNOWN,   /* XF86Send */
   412     /* 232 */   SDL_SCANCODE_UNKNOWN,   /* XF86Reply */
   413     /* 233 */   SDL_SCANCODE_UNKNOWN,   /* XF86MailForward */
   414     /* 234 */   SDL_SCANCODE_UNKNOWN,   /* XF86Save */
   415     /* 235 */   SDL_SCANCODE_UNKNOWN,   /* XF86Documents */
   416     /* 236 */   SDL_SCANCODE_UNKNOWN,   /* XF86Battery */
   417     /* 237 */   SDL_SCANCODE_UNKNOWN,   /* XF86Bluetooth */
   418     /* 238 */   SDL_SCANCODE_UNKNOWN,   /* XF86WLAN */
   419 };
   420 
   421 /* Xvnc / Xtightvnc scancodes from xmodmap -pk */
   422 static const SDL_Scancode xvnc_scancode_table[] = {
   423     /*  0 */    SDL_SCANCODE_LCTRL,
   424     /*  1 */    SDL_SCANCODE_RCTRL,
   425     /*  2 */    SDL_SCANCODE_LSHIFT,
   426     /*  3 */    SDL_SCANCODE_RSHIFT,
   427     /*  4 */    SDL_SCANCODE_UNKNOWN, /* Meta_L */
   428     /*  5 */    SDL_SCANCODE_UNKNOWN, /* Meta_R */
   429     /*  6 */    SDL_SCANCODE_LALT,
   430     /*  7 */    SDL_SCANCODE_RALT,
   431     /*  8 */    SDL_SCANCODE_SPACE,
   432     /*  9 */    SDL_SCANCODE_0,
   433     /*  10 */   SDL_SCANCODE_1,
   434     /*  11 */   SDL_SCANCODE_2,
   435     /*  12 */   SDL_SCANCODE_3,
   436     /*  13 */   SDL_SCANCODE_4,
   437     /*  14 */   SDL_SCANCODE_5,
   438     /*  15 */   SDL_SCANCODE_6,
   439     /*  16 */   SDL_SCANCODE_7,
   440     /*  17 */   SDL_SCANCODE_8,
   441     /*  18 */   SDL_SCANCODE_9,
   442     /*  19 */   SDL_SCANCODE_MINUS,
   443     /*  20 */   SDL_SCANCODE_EQUALS,
   444     /*  21 */   SDL_SCANCODE_LEFTBRACKET,
   445     /*  22 */   SDL_SCANCODE_RIGHTBRACKET,
   446     /*  23 */   SDL_SCANCODE_SEMICOLON,
   447     /*  24 */   SDL_SCANCODE_APOSTROPHE,
   448     /*  25 */   SDL_SCANCODE_GRAVE,
   449     /*  26 */   SDL_SCANCODE_COMMA,
   450     /*  27 */   SDL_SCANCODE_PERIOD,
   451     /*  28 */   SDL_SCANCODE_SLASH,
   452     /*  29 */   SDL_SCANCODE_BACKSLASH,
   453     /*  30 */   SDL_SCANCODE_A,
   454     /*  31 */   SDL_SCANCODE_B,
   455     /*  32 */   SDL_SCANCODE_C,
   456     /*  33 */   SDL_SCANCODE_D,
   457     /*  34 */   SDL_SCANCODE_E,
   458     /*  35 */   SDL_SCANCODE_F,
   459     /*  36 */   SDL_SCANCODE_G,
   460     /*  37 */   SDL_SCANCODE_H,
   461     /*  38 */   SDL_SCANCODE_I,
   462     /*  39 */   SDL_SCANCODE_J,
   463     /*  40 */   SDL_SCANCODE_K,
   464     /*  41 */   SDL_SCANCODE_L,
   465     /*  42 */   SDL_SCANCODE_M,
   466     /*  43 */   SDL_SCANCODE_N,
   467     /*  44 */   SDL_SCANCODE_O,
   468     /*  45 */   SDL_SCANCODE_P,
   469     /*  46 */   SDL_SCANCODE_Q,
   470     /*  47 */   SDL_SCANCODE_R,
   471     /*  48 */   SDL_SCANCODE_S,
   472     /*  49 */   SDL_SCANCODE_T,
   473     /*  50 */   SDL_SCANCODE_U,
   474     /*  51 */   SDL_SCANCODE_V,
   475     /*  52 */   SDL_SCANCODE_W,
   476     /*  53 */   SDL_SCANCODE_X,
   477     /*  54 */   SDL_SCANCODE_Y,
   478     /*  55 */   SDL_SCANCODE_Z,
   479     /*  56 */   SDL_SCANCODE_BACKSPACE,
   480     /*  57 */   SDL_SCANCODE_RETURN,
   481     /*  58 */   SDL_SCANCODE_TAB,
   482     /*  59 */   SDL_SCANCODE_ESCAPE,
   483     /*  60 */   SDL_SCANCODE_DELETE,
   484     /*  61 */   SDL_SCANCODE_HOME,
   485     /*  62 */   SDL_SCANCODE_END,
   486     /*  63 */   SDL_SCANCODE_PAGEUP,
   487     /*  64 */   SDL_SCANCODE_PAGEDOWN,
   488     /*  65 */   SDL_SCANCODE_UP,
   489     /*  66 */   SDL_SCANCODE_DOWN,
   490     /*  67 */   SDL_SCANCODE_LEFT,
   491     /*  68 */   SDL_SCANCODE_RIGHT,
   492     /*  69 */   SDL_SCANCODE_F1,
   493     /*  70 */   SDL_SCANCODE_F2,
   494     /*  71 */   SDL_SCANCODE_F3,
   495     /*  72 */   SDL_SCANCODE_F4,
   496     /*  73 */   SDL_SCANCODE_F5,
   497     /*  74 */   SDL_SCANCODE_F6,
   498     /*  75 */   SDL_SCANCODE_F7,
   499     /*  76 */   SDL_SCANCODE_F8,
   500     /*  77 */   SDL_SCANCODE_F9,
   501     /*  78 */   SDL_SCANCODE_F10,
   502     /*  79 */   SDL_SCANCODE_F11,
   503     /*  80 */   SDL_SCANCODE_F12,
   504 };
   505 
   506 /* *INDENT-ON* */