src/events/scancodes_linux.h
changeset 2305 fbe8ff44c519
child 2859 99210400e8b9
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/events/scancodes_linux.h	Thu Feb 07 15:31:09 2008 +0000
     1.3 @@ -0,0 +1,264 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2006 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "../../include/SDL_scancode.h"
    1.26 +
    1.27 +/* Linux virtual key code to SDLKey mapping table
    1.28 +   Sources:
    1.29 +   - Linux kernel source input.h
    1.30 +*/
    1.31 +/* *INDENT-OFF* */
    1.32 +static SDL_scancode linux_scancode_table[] = {
    1.33 +    /*  0 */    SDL_SCANCODE_UNKNOWN,
    1.34 +    /*  1 */    SDL_SCANCODE_ESCAPE,
    1.35 +    /*  2 */    SDL_SCANCODE_1,
    1.36 +    /*  3 */    SDL_SCANCODE_2,
    1.37 +    /*  4 */    SDL_SCANCODE_3,
    1.38 +    /*  5 */    SDL_SCANCODE_4,
    1.39 +    /*  6 */    SDL_SCANCODE_5,
    1.40 +    /*  7 */    SDL_SCANCODE_6,
    1.41 +    /*  8 */    SDL_SCANCODE_7,
    1.42 +    /*  9 */    SDL_SCANCODE_8,
    1.43 +    /*  10 */    SDL_SCANCODE_9,
    1.44 +    /*  11 */    SDL_SCANCODE_0,
    1.45 +    /*  12 */    SDL_SCANCODE_MINUS,
    1.46 +    /*  13 */    SDL_SCANCODE_EQUALS,
    1.47 +    /*  14 */    SDL_SCANCODE_BACKSPACE,
    1.48 +    /*  15 */    SDL_SCANCODE_TAB,
    1.49 +    /*  16 */    SDL_SCANCODE_Q,
    1.50 +    /*  17 */    SDL_SCANCODE_W,
    1.51 +    /*  18 */    SDL_SCANCODE_E,
    1.52 +    /*  19 */    SDL_SCANCODE_R,
    1.53 +    /*  20 */    SDL_SCANCODE_T,
    1.54 +    /*  21 */    SDL_SCANCODE_Y,
    1.55 +    /*  22 */    SDL_SCANCODE_U,
    1.56 +    /*  23 */    SDL_SCANCODE_I,
    1.57 +    /*  24 */    SDL_SCANCODE_O,
    1.58 +    /*  25 */    SDL_SCANCODE_P,
    1.59 +    /*  26 */    SDL_SCANCODE_LEFTBRACKET,
    1.60 +    /*  27 */    SDL_SCANCODE_RIGHTBRACKET,
    1.61 +    /*  28 */    SDL_SCANCODE_RETURN,
    1.62 +    /*  29 */    SDL_SCANCODE_LCTRL,
    1.63 +    /*  30 */    SDL_SCANCODE_A,
    1.64 +    /*  31 */    SDL_SCANCODE_S,
    1.65 +    /*  32 */    SDL_SCANCODE_D,
    1.66 +    /*  33 */    SDL_SCANCODE_F,
    1.67 +    /*  34 */    SDL_SCANCODE_G,
    1.68 +    /*  35 */    SDL_SCANCODE_H,
    1.69 +    /*  36 */    SDL_SCANCODE_J,
    1.70 +    /*  37 */    SDL_SCANCODE_K,
    1.71 +    /*  38 */    SDL_SCANCODE_L,
    1.72 +    /*  39 */    SDL_SCANCODE_SEMICOLON,
    1.73 +    /*  40 */    SDL_SCANCODE_APOSTROPHE,
    1.74 +    /*  41 */    SDL_SCANCODE_GRAVE,
    1.75 +    /*  42 */    SDL_SCANCODE_LSHIFT,
    1.76 +    /*  43 */    SDL_SCANCODE_BACKSLASH,
    1.77 +    /*  44 */    SDL_SCANCODE_Z,
    1.78 +    /*  45 */    SDL_SCANCODE_X,
    1.79 +    /*  46 */    SDL_SCANCODE_C,
    1.80 +    /*  47 */    SDL_SCANCODE_V,
    1.81 +    /*  48 */    SDL_SCANCODE_B,
    1.82 +    /*  49 */    SDL_SCANCODE_N,
    1.83 +    /*  50 */    SDL_SCANCODE_M,
    1.84 +    /*  51 */    SDL_SCANCODE_COMMA,
    1.85 +    /*  52 */    SDL_SCANCODE_PERIOD,
    1.86 +    /*  53 */    SDL_SCANCODE_SLASH,
    1.87 +    /*  54 */    SDL_SCANCODE_RSHIFT,
    1.88 +    /*  55 */    SDL_SCANCODE_KP_MULTIPLY,
    1.89 +    /*  56 */    SDL_SCANCODE_LALT,
    1.90 +    /*  57 */    SDL_SCANCODE_SPACE,
    1.91 +    /*  58 */    SDL_SCANCODE_CAPSLOCK,
    1.92 +    /*  59 */    SDL_SCANCODE_F1,
    1.93 +    /*  60 */    SDL_SCANCODE_F2,
    1.94 +    /*  61 */    SDL_SCANCODE_F3,
    1.95 +    /*  62 */    SDL_SCANCODE_F4,
    1.96 +    /*  63 */    SDL_SCANCODE_F5,
    1.97 +    /*  64 */    SDL_SCANCODE_F6,
    1.98 +    /*  65 */    SDL_SCANCODE_F7,
    1.99 +    /*  66 */    SDL_SCANCODE_F8,
   1.100 +    /*  67 */    SDL_SCANCODE_F9,
   1.101 +    /*  68 */    SDL_SCANCODE_F10,
   1.102 +    /*  69 */    SDL_SCANCODE_NUMLOCKCLEAR,
   1.103 +    /*  70 */    SDL_SCANCODE_SCROLLLOCK,
   1.104 +    /*  71 */    SDL_SCANCODE_KP_7,
   1.105 +    /*  72 */    SDL_SCANCODE_KP_8,
   1.106 +    /*  73 */    SDL_SCANCODE_KP_9,
   1.107 +    /*  74 */    SDL_SCANCODE_KP_MINUS,
   1.108 +    /*  75 */    SDL_SCANCODE_KP_4,
   1.109 +    /*  76 */    SDL_SCANCODE_KP_5,
   1.110 +    /*  77 */    SDL_SCANCODE_KP_6,
   1.111 +    /*  78 */    SDL_SCANCODE_KP_PLUS,
   1.112 +    /*  79 */    SDL_SCANCODE_KP_1,
   1.113 +    /*  80 */    SDL_SCANCODE_KP_2,
   1.114 +    /*  81 */    SDL_SCANCODE_KP_3,
   1.115 +    /*  82 */    SDL_SCANCODE_KP_0,
   1.116 +    /*  83 */    SDL_SCANCODE_KP_PERIOD,
   1.117 +    0,
   1.118 +    /*  85 */    SDL_SCANCODE_UNKNOWN, /* KEY_ZENKAKUHANKAKU */
   1.119 +    /*  86 */    SDL_SCANCODE_NONUSBACKSLASH, /* KEY_102ND */
   1.120 +    /*  87 */    SDL_SCANCODE_F11,
   1.121 +    /*  88 */    SDL_SCANCODE_F12,
   1.122 +    /*  89 */    SDL_SCANCODE_INTERNATIONAL1, /* KEY_RO */
   1.123 +    /*  90 */    SDL_SCANCODE_LANG3, /* KEY_KATAKANA */
   1.124 +    /*  91 */    SDL_SCANCODE_LANG4, /* KEY_HIRAGANA */
   1.125 +    /*  92 */    SDL_SCANCODE_INTERNATIONAL4, /* KEY_HENKAN */
   1.126 +    /*  93 */    SDL_SCANCODE_INTERNATIONAL2, /* KEY_KATAKANAHIRAGANA */
   1.127 +    /*  94 */    SDL_SCANCODE_INTERNATIONAL5, /* KEY_MUHENKAN */
   1.128 +    /*  95 */    SDL_SCANCODE_INTERNATIONAL5, /* KEY_KPJPCOMMA */
   1.129 +    /*  96 */    SDL_SCANCODE_KP_ENTER,
   1.130 +    /*  97 */    SDL_SCANCODE_RCTRL,
   1.131 +    /*  98 */    SDL_SCANCODE_KP_DIVIDE,
   1.132 +    /*  99 */    SDL_SCANCODE_SYSREQ,
   1.133 +    /*  100 */    SDL_SCANCODE_RALT,
   1.134 +    /*  101 */    SDL_SCANCODE_UNKNOWN, /* KEY_LINEFEED */
   1.135 +    /*  102 */    SDL_SCANCODE_HOME,
   1.136 +    /*  103 */    SDL_SCANCODE_UP,
   1.137 +    /*  104 */    SDL_SCANCODE_PAGEUP,
   1.138 +    /*  105 */    SDL_SCANCODE_LEFT,
   1.139 +    /*  106 */    SDL_SCANCODE_RIGHT,
   1.140 +    /*  107 */    SDL_SCANCODE_END,
   1.141 +    /*  108 */    SDL_SCANCODE_DOWN,
   1.142 +    /*  109 */    SDL_SCANCODE_PAGEDOWN,
   1.143 +    /*  110 */    SDL_SCANCODE_INSERT,
   1.144 +    /*  111 */    SDL_SCANCODE_DELETE,
   1.145 +    /*  112 */    SDL_SCANCODE_UNKNOWN, /* KEY_MACRO */
   1.146 +    /*  113 */    SDL_SCANCODE_MUTE,
   1.147 +    /*  114 */    SDL_SCANCODE_VOLUMEDOWN,
   1.148 +    /*  115 */    SDL_SCANCODE_VOLUMEUP,
   1.149 +    /*  116 */    SDL_SCANCODE_POWER,
   1.150 +    /*  117 */    SDL_SCANCODE_KP_EQUALS,
   1.151 +    /*  118 */    SDL_SCANCODE_KP_PLUSMINUS,
   1.152 +    /*  119 */    SDL_SCANCODE_PAUSE,
   1.153 +    0,
   1.154 +    /*  121 */    SDL_SCANCODE_KP_COMMA,
   1.155 +    /*  122 */    SDL_SCANCODE_LANG1, /* KEY_HANGUEL */
   1.156 +    /*  123 */    SDL_SCANCODE_LANG2, /* KEY_HANJA */
   1.157 +    /*  124 */    SDL_SCANCODE_INTERNATIONAL3, /* KEY_YEN */
   1.158 +    /*  125 */    SDL_SCANCODE_LGUI,
   1.159 +    /*  126 */    SDL_SCANCODE_RGUI,
   1.160 +    /*  127 */    SDL_SCANCODE_UNKNOWN, /* KEY_COMPOSE */
   1.161 +    /*  128 */    SDL_SCANCODE_STOP,
   1.162 +    /*  129 */    SDL_SCANCODE_AGAIN,
   1.163 +    /*  130 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROPS */
   1.164 +    /*  131 */    SDL_SCANCODE_UNDO,
   1.165 +    /*  132 */    SDL_SCANCODE_UNKNOWN, /* KEY_FRONT */
   1.166 +    /*  133 */    SDL_SCANCODE_COPY,
   1.167 +    /*  134 */    SDL_SCANCODE_UNKNOWN, /* KEY_OPEN */
   1.168 +    /*  135 */    SDL_SCANCODE_PASTE,
   1.169 +    /*  136 */    SDL_SCANCODE_FIND,
   1.170 +    /*  137 */    SDL_SCANCODE_CUT,
   1.171 +    /*  138 */    SDL_SCANCODE_HELP,
   1.172 +    /*  139 */    SDL_SCANCODE_MENU,
   1.173 +    /*  140 */    SDL_SCANCODE_CALCULATOR,
   1.174 +    /*  141 */    SDL_SCANCODE_UNKNOWN, /* KEY_SETUP */
   1.175 +    /*  142 */    SDL_SCANCODE_SLEEP,
   1.176 +    /*  143 */    SDL_SCANCODE_UNKNOWN, /* KEY_WAKEUP */
   1.177 +    /*  144 */    SDL_SCANCODE_UNKNOWN, /* KEY_FILE */
   1.178 +    /*  145 */    SDL_SCANCODE_UNKNOWN, /* KEY_SENDFILE */
   1.179 +    /*  146 */    SDL_SCANCODE_UNKNOWN, /* KEY_DELETEFILE */
   1.180 +    /*  147 */    SDL_SCANCODE_UNKNOWN, /* KEY_XFER */
   1.181 +    /*  148 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROG1 */
   1.182 +    /*  149 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROG2 */
   1.183 +    /*  150 */    SDL_SCANCODE_UNKNOWN, /* KEY_WWW */
   1.184 +    /*  151 */    SDL_SCANCODE_UNKNOWN, /* KEY_MSDOS */
   1.185 +    /*  152 */    SDL_SCANCODE_UNKNOWN, /* KEY_COFFEE */
   1.186 +    /*  153 */    SDL_SCANCODE_UNKNOWN, /* KEY_DIRECTION */
   1.187 +    /*  154 */    SDL_SCANCODE_UNKNOWN, /* KEY_CYCLEWINDOWS */
   1.188 +    /*  155 */    SDL_SCANCODE_MAIL,
   1.189 +    /*  156 */    SDL_SCANCODE_AC_BOOKMARKS,
   1.190 +    /*  157 */    SDL_SCANCODE_COMPUTER,
   1.191 +    /*  158 */    SDL_SCANCODE_AC_BACK,
   1.192 +    /*  159 */    SDL_SCANCODE_AC_FORWARD,
   1.193 +    /*  160 */    SDL_SCANCODE_UNKNOWN, /* KEY_CLOSECD */
   1.194 +    /*  161 */    SDL_SCANCODE_EJECT, /* KEY_EJECTCD */
   1.195 +    /*  162 */    SDL_SCANCODE_UNKNOWN, /* KEY_EJECTCLOSECD */
   1.196 +    /*  163 */    SDL_SCANCODE_AUDIONEXT, /* KEY_NEXTSONG */
   1.197 +    /*  164 */    SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAYPAUSE */
   1.198 +    /*  165 */    SDL_SCANCODE_AUDIOPREV, /* KEY_PREVIOUSSONG */
   1.199 +    /*  166 */    SDL_SCANCODE_UNKNOWN, /* KEY_STOPCD */
   1.200 +    /*  167 */    SDL_SCANCODE_UNKNOWN, /* KEY_RECORD */
   1.201 +    /*  168 */    SDL_SCANCODE_UNKNOWN, /* KEY_REWIND */
   1.202 +    /*  169 */    SDL_SCANCODE_UNKNOWN, /* KEY_PHONE */
   1.203 +    /*  170 */    SDL_SCANCODE_UNKNOWN, /* KEY_ISO */
   1.204 +    /*  171 */    SDL_SCANCODE_UNKNOWN, /* KEY_CONFIG */
   1.205 +    /*  172 */    SDL_SCANCODE_AC_HOME,
   1.206 +    /*  173 */    SDL_SCANCODE_AC_REFRESH,
   1.207 +    /*  174 */    SDL_SCANCODE_UNKNOWN, /* KEY_EXIT */
   1.208 +    /*  175 */    SDL_SCANCODE_UNKNOWN, /* KEY_MOVE */
   1.209 +    /*  176 */    SDL_SCANCODE_UNKNOWN, /* KEY_EDIT */
   1.210 +    /*  177 */    SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLUP */
   1.211 +    /*  178 */    SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLDOWN */
   1.212 +    /*  179 */    SDL_SCANCODE_KP_LEFTPAREN,
   1.213 +    /*  180 */    SDL_SCANCODE_KP_RIGHTPAREN,
   1.214 +    /*  181 */    SDL_SCANCODE_UNKNOWN, /* KEY_NEW */
   1.215 +    /*  182 */    SDL_SCANCODE_UNKNOWN, /* KEY_REDO */
   1.216 +    /*  183 */    SDL_SCANCODE_F13,
   1.217 +    /*  184 */    SDL_SCANCODE_F14,
   1.218 +    /*  185 */    SDL_SCANCODE_F15,
   1.219 +    /*  186 */    SDL_SCANCODE_F16,
   1.220 +    /*  187 */    SDL_SCANCODE_F17,
   1.221 +    /*  188 */    SDL_SCANCODE_F18,
   1.222 +    /*  189 */    SDL_SCANCODE_F19,
   1.223 +    /*  190 */    SDL_SCANCODE_F20,
   1.224 +    /*  191 */    SDL_SCANCODE_F21,
   1.225 +    /*  192 */    SDL_SCANCODE_F22,
   1.226 +    /*  193 */    SDL_SCANCODE_F23,
   1.227 +    /*  194 */    SDL_SCANCODE_F24,
   1.228 +    0, 0, 0, 0,
   1.229 +    /*  200 */    SDL_SCANCODE_UNKNOWN, /* KEY_PLAYCD */
   1.230 +    /*  201 */    SDL_SCANCODE_UNKNOWN, /* KEY_PAUSECD */
   1.231 +    /*  202 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROG3 */
   1.232 +    /*  203 */    SDL_SCANCODE_UNKNOWN, /* KEY_PROG4 */
   1.233 +    0,
   1.234 +    /*  205 */    SDL_SCANCODE_UNKNOWN, /* KEY_SUSPEND */
   1.235 +    /*  206 */    SDL_SCANCODE_UNKNOWN, /* KEY_CLOSE */
   1.236 +    /*  207 */    SDL_SCANCODE_UNKNOWN, /* KEY_PLAY */
   1.237 +    /*  208 */    SDL_SCANCODE_UNKNOWN, /* KEY_FASTFORWARD */
   1.238 +    /*  209 */    SDL_SCANCODE_UNKNOWN, /* KEY_BASSBOOST */
   1.239 +    /*  210 */    SDL_SCANCODE_UNKNOWN, /* KEY_PRINT */
   1.240 +    /*  211 */    SDL_SCANCODE_UNKNOWN, /* KEY_HP */
   1.241 +    /*  212 */    SDL_SCANCODE_UNKNOWN, /* KEY_CAMERA */
   1.242 +    /*  213 */    SDL_SCANCODE_UNKNOWN, /* KEY_SOUND */
   1.243 +    /*  214 */    SDL_SCANCODE_UNKNOWN, /* KEY_QUESTION */
   1.244 +    /*  215 */    SDL_SCANCODE_UNKNOWN, /* KEY_EMAIL */
   1.245 +    /*  216 */    SDL_SCANCODE_UNKNOWN, /* KEY_CHAT */
   1.246 +    /*  217 */    SDL_SCANCODE_AC_SEARCH,
   1.247 +    /*  218 */    SDL_SCANCODE_UNKNOWN, /* KEY_CONNECT */
   1.248 +    /*  219 */    SDL_SCANCODE_UNKNOWN, /* KEY_FINANCE */
   1.249 +    /*  220 */    SDL_SCANCODE_UNKNOWN, /* KEY_SPORT */
   1.250 +    /*  221 */    SDL_SCANCODE_UNKNOWN, /* KEY_SHOP */
   1.251 +    /*  222 */    SDL_SCANCODE_ALTERASE,
   1.252 +    /*  223 */    SDL_SCANCODE_CANCEL,
   1.253 +    /*  224 */    SDL_SCANCODE_BRIGHTNESSDOWN,
   1.254 +    /*  225 */    SDL_SCANCODE_BRIGHTNESSUP,
   1.255 +    /*  226 */    SDL_SCANCODE_UNKNOWN, /* KEY_MEDIA */
   1.256 +    /*  227 */    SDL_SCANCODE_DISPLAYSWITCH, /* KEY_SWITCHVIDEOMODE */
   1.257 +    /*  228 */    SDL_SCANCODE_KBDILLUMTOGGLE,
   1.258 +    /*  229 */    SDL_SCANCODE_KBDILLUMDOWN,
   1.259 +    /*  230 */    SDL_SCANCODE_KBDILLUMUP,
   1.260 +    /*  231 */    SDL_SCANCODE_UNKNOWN, /* KEY_SEND */
   1.261 +    /*  232 */    SDL_SCANCODE_UNKNOWN, /* KEY_REPLY */
   1.262 +    /*  233 */    SDL_SCANCODE_UNKNOWN, /* KEY_FORWARDMAIL */
   1.263 +    /*  234 */    SDL_SCANCODE_UNKNOWN, /* KEY_SAVE */
   1.264 +    /*  235 */    SDL_SCANCODE_UNKNOWN, /* KEY_DOCUMENTS */
   1.265 +    /*  236 */    SDL_SCANCODE_UNKNOWN, /* KEY_BATTERY */
   1.266 +};
   1.267 +/* *INDENT-ON* */