comparison src/events/scancodes_linux.h @ 2305:fbe8ff44c519

First pass of new SDL scancode concept for X11.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 07 Feb 2008 15:31:09 +0000
parents
children 99210400e8b9
comparison
equal deleted inserted replaced
2304:50f58ce12497 2305:fbe8ff44c519
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2006 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22 #include "../../include/SDL_scancode.h"
23
24 /* Linux virtual key code to SDLKey mapping table
25 Sources:
26 - Linux kernel source input.h
27 */
28 /* *INDENT-OFF* */
29 static SDL_scancode linux_scancode_table[] = {
30 /* 0 */ SDL_SCANCODE_UNKNOWN,
31 /* 1 */ SDL_SCANCODE_ESCAPE,
32 /* 2 */ SDL_SCANCODE_1,
33 /* 3 */ SDL_SCANCODE_2,
34 /* 4 */ SDL_SCANCODE_3,
35 /* 5 */ SDL_SCANCODE_4,
36 /* 6 */ SDL_SCANCODE_5,
37 /* 7 */ SDL_SCANCODE_6,
38 /* 8 */ SDL_SCANCODE_7,
39 /* 9 */ SDL_SCANCODE_8,
40 /* 10 */ SDL_SCANCODE_9,
41 /* 11 */ SDL_SCANCODE_0,
42 /* 12 */ SDL_SCANCODE_MINUS,
43 /* 13 */ SDL_SCANCODE_EQUALS,
44 /* 14 */ SDL_SCANCODE_BACKSPACE,
45 /* 15 */ SDL_SCANCODE_TAB,
46 /* 16 */ SDL_SCANCODE_Q,
47 /* 17 */ SDL_SCANCODE_W,
48 /* 18 */ SDL_SCANCODE_E,
49 /* 19 */ SDL_SCANCODE_R,
50 /* 20 */ SDL_SCANCODE_T,
51 /* 21 */ SDL_SCANCODE_Y,
52 /* 22 */ SDL_SCANCODE_U,
53 /* 23 */ SDL_SCANCODE_I,
54 /* 24 */ SDL_SCANCODE_O,
55 /* 25 */ SDL_SCANCODE_P,
56 /* 26 */ SDL_SCANCODE_LEFTBRACKET,
57 /* 27 */ SDL_SCANCODE_RIGHTBRACKET,
58 /* 28 */ SDL_SCANCODE_RETURN,
59 /* 29 */ SDL_SCANCODE_LCTRL,
60 /* 30 */ SDL_SCANCODE_A,
61 /* 31 */ SDL_SCANCODE_S,
62 /* 32 */ SDL_SCANCODE_D,
63 /* 33 */ SDL_SCANCODE_F,
64 /* 34 */ SDL_SCANCODE_G,
65 /* 35 */ SDL_SCANCODE_H,
66 /* 36 */ SDL_SCANCODE_J,
67 /* 37 */ SDL_SCANCODE_K,
68 /* 38 */ SDL_SCANCODE_L,
69 /* 39 */ SDL_SCANCODE_SEMICOLON,
70 /* 40 */ SDL_SCANCODE_APOSTROPHE,
71 /* 41 */ SDL_SCANCODE_GRAVE,
72 /* 42 */ SDL_SCANCODE_LSHIFT,
73 /* 43 */ SDL_SCANCODE_BACKSLASH,
74 /* 44 */ SDL_SCANCODE_Z,
75 /* 45 */ SDL_SCANCODE_X,
76 /* 46 */ SDL_SCANCODE_C,
77 /* 47 */ SDL_SCANCODE_V,
78 /* 48 */ SDL_SCANCODE_B,
79 /* 49 */ SDL_SCANCODE_N,
80 /* 50 */ SDL_SCANCODE_M,
81 /* 51 */ SDL_SCANCODE_COMMA,
82 /* 52 */ SDL_SCANCODE_PERIOD,
83 /* 53 */ SDL_SCANCODE_SLASH,
84 /* 54 */ SDL_SCANCODE_RSHIFT,
85 /* 55 */ SDL_SCANCODE_KP_MULTIPLY,
86 /* 56 */ SDL_SCANCODE_LALT,
87 /* 57 */ SDL_SCANCODE_SPACE,
88 /* 58 */ SDL_SCANCODE_CAPSLOCK,
89 /* 59 */ SDL_SCANCODE_F1,
90 /* 60 */ SDL_SCANCODE_F2,
91 /* 61 */ SDL_SCANCODE_F3,
92 /* 62 */ SDL_SCANCODE_F4,
93 /* 63 */ SDL_SCANCODE_F5,
94 /* 64 */ SDL_SCANCODE_F6,
95 /* 65 */ SDL_SCANCODE_F7,
96 /* 66 */ SDL_SCANCODE_F8,
97 /* 67 */ SDL_SCANCODE_F9,
98 /* 68 */ SDL_SCANCODE_F10,
99 /* 69 */ SDL_SCANCODE_NUMLOCKCLEAR,
100 /* 70 */ SDL_SCANCODE_SCROLLLOCK,
101 /* 71 */ SDL_SCANCODE_KP_7,
102 /* 72 */ SDL_SCANCODE_KP_8,
103 /* 73 */ SDL_SCANCODE_KP_9,
104 /* 74 */ SDL_SCANCODE_KP_MINUS,
105 /* 75 */ SDL_SCANCODE_KP_4,
106 /* 76 */ SDL_SCANCODE_KP_5,
107 /* 77 */ SDL_SCANCODE_KP_6,
108 /* 78 */ SDL_SCANCODE_KP_PLUS,
109 /* 79 */ SDL_SCANCODE_KP_1,
110 /* 80 */ SDL_SCANCODE_KP_2,
111 /* 81 */ SDL_SCANCODE_KP_3,
112 /* 82 */ SDL_SCANCODE_KP_0,
113 /* 83 */ SDL_SCANCODE_KP_PERIOD,
114 0,
115 /* 85 */ SDL_SCANCODE_UNKNOWN, /* KEY_ZENKAKUHANKAKU */
116 /* 86 */ SDL_SCANCODE_NONUSBACKSLASH, /* KEY_102ND */
117 /* 87 */ SDL_SCANCODE_F11,
118 /* 88 */ SDL_SCANCODE_F12,
119 /* 89 */ SDL_SCANCODE_INTERNATIONAL1, /* KEY_RO */
120 /* 90 */ SDL_SCANCODE_LANG3, /* KEY_KATAKANA */
121 /* 91 */ SDL_SCANCODE_LANG4, /* KEY_HIRAGANA */
122 /* 92 */ SDL_SCANCODE_INTERNATIONAL4, /* KEY_HENKAN */
123 /* 93 */ SDL_SCANCODE_INTERNATIONAL2, /* KEY_KATAKANAHIRAGANA */
124 /* 94 */ SDL_SCANCODE_INTERNATIONAL5, /* KEY_MUHENKAN */
125 /* 95 */ SDL_SCANCODE_INTERNATIONAL5, /* KEY_KPJPCOMMA */
126 /* 96 */ SDL_SCANCODE_KP_ENTER,
127 /* 97 */ SDL_SCANCODE_RCTRL,
128 /* 98 */ SDL_SCANCODE_KP_DIVIDE,
129 /* 99 */ SDL_SCANCODE_SYSREQ,
130 /* 100 */ SDL_SCANCODE_RALT,
131 /* 101 */ SDL_SCANCODE_UNKNOWN, /* KEY_LINEFEED */
132 /* 102 */ SDL_SCANCODE_HOME,
133 /* 103 */ SDL_SCANCODE_UP,
134 /* 104 */ SDL_SCANCODE_PAGEUP,
135 /* 105 */ SDL_SCANCODE_LEFT,
136 /* 106 */ SDL_SCANCODE_RIGHT,
137 /* 107 */ SDL_SCANCODE_END,
138 /* 108 */ SDL_SCANCODE_DOWN,
139 /* 109 */ SDL_SCANCODE_PAGEDOWN,
140 /* 110 */ SDL_SCANCODE_INSERT,
141 /* 111 */ SDL_SCANCODE_DELETE,
142 /* 112 */ SDL_SCANCODE_UNKNOWN, /* KEY_MACRO */
143 /* 113 */ SDL_SCANCODE_MUTE,
144 /* 114 */ SDL_SCANCODE_VOLUMEDOWN,
145 /* 115 */ SDL_SCANCODE_VOLUMEUP,
146 /* 116 */ SDL_SCANCODE_POWER,
147 /* 117 */ SDL_SCANCODE_KP_EQUALS,
148 /* 118 */ SDL_SCANCODE_KP_PLUSMINUS,
149 /* 119 */ SDL_SCANCODE_PAUSE,
150 0,
151 /* 121 */ SDL_SCANCODE_KP_COMMA,
152 /* 122 */ SDL_SCANCODE_LANG1, /* KEY_HANGUEL */
153 /* 123 */ SDL_SCANCODE_LANG2, /* KEY_HANJA */
154 /* 124 */ SDL_SCANCODE_INTERNATIONAL3, /* KEY_YEN */
155 /* 125 */ SDL_SCANCODE_LGUI,
156 /* 126 */ SDL_SCANCODE_RGUI,
157 /* 127 */ SDL_SCANCODE_UNKNOWN, /* KEY_COMPOSE */
158 /* 128 */ SDL_SCANCODE_STOP,
159 /* 129 */ SDL_SCANCODE_AGAIN,
160 /* 130 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROPS */
161 /* 131 */ SDL_SCANCODE_UNDO,
162 /* 132 */ SDL_SCANCODE_UNKNOWN, /* KEY_FRONT */
163 /* 133 */ SDL_SCANCODE_COPY,
164 /* 134 */ SDL_SCANCODE_UNKNOWN, /* KEY_OPEN */
165 /* 135 */ SDL_SCANCODE_PASTE,
166 /* 136 */ SDL_SCANCODE_FIND,
167 /* 137 */ SDL_SCANCODE_CUT,
168 /* 138 */ SDL_SCANCODE_HELP,
169 /* 139 */ SDL_SCANCODE_MENU,
170 /* 140 */ SDL_SCANCODE_CALCULATOR,
171 /* 141 */ SDL_SCANCODE_UNKNOWN, /* KEY_SETUP */
172 /* 142 */ SDL_SCANCODE_SLEEP,
173 /* 143 */ SDL_SCANCODE_UNKNOWN, /* KEY_WAKEUP */
174 /* 144 */ SDL_SCANCODE_UNKNOWN, /* KEY_FILE */
175 /* 145 */ SDL_SCANCODE_UNKNOWN, /* KEY_SENDFILE */
176 /* 146 */ SDL_SCANCODE_UNKNOWN, /* KEY_DELETEFILE */
177 /* 147 */ SDL_SCANCODE_UNKNOWN, /* KEY_XFER */
178 /* 148 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG1 */
179 /* 149 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG2 */
180 /* 150 */ SDL_SCANCODE_UNKNOWN, /* KEY_WWW */
181 /* 151 */ SDL_SCANCODE_UNKNOWN, /* KEY_MSDOS */
182 /* 152 */ SDL_SCANCODE_UNKNOWN, /* KEY_COFFEE */
183 /* 153 */ SDL_SCANCODE_UNKNOWN, /* KEY_DIRECTION */
184 /* 154 */ SDL_SCANCODE_UNKNOWN, /* KEY_CYCLEWINDOWS */
185 /* 155 */ SDL_SCANCODE_MAIL,
186 /* 156 */ SDL_SCANCODE_AC_BOOKMARKS,
187 /* 157 */ SDL_SCANCODE_COMPUTER,
188 /* 158 */ SDL_SCANCODE_AC_BACK,
189 /* 159 */ SDL_SCANCODE_AC_FORWARD,
190 /* 160 */ SDL_SCANCODE_UNKNOWN, /* KEY_CLOSECD */
191 /* 161 */ SDL_SCANCODE_EJECT, /* KEY_EJECTCD */
192 /* 162 */ SDL_SCANCODE_UNKNOWN, /* KEY_EJECTCLOSECD */
193 /* 163 */ SDL_SCANCODE_AUDIONEXT, /* KEY_NEXTSONG */
194 /* 164 */ SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAYPAUSE */
195 /* 165 */ SDL_SCANCODE_AUDIOPREV, /* KEY_PREVIOUSSONG */
196 /* 166 */ SDL_SCANCODE_UNKNOWN, /* KEY_STOPCD */
197 /* 167 */ SDL_SCANCODE_UNKNOWN, /* KEY_RECORD */
198 /* 168 */ SDL_SCANCODE_UNKNOWN, /* KEY_REWIND */
199 /* 169 */ SDL_SCANCODE_UNKNOWN, /* KEY_PHONE */
200 /* 170 */ SDL_SCANCODE_UNKNOWN, /* KEY_ISO */
201 /* 171 */ SDL_SCANCODE_UNKNOWN, /* KEY_CONFIG */
202 /* 172 */ SDL_SCANCODE_AC_HOME,
203 /* 173 */ SDL_SCANCODE_AC_REFRESH,
204 /* 174 */ SDL_SCANCODE_UNKNOWN, /* KEY_EXIT */
205 /* 175 */ SDL_SCANCODE_UNKNOWN, /* KEY_MOVE */
206 /* 176 */ SDL_SCANCODE_UNKNOWN, /* KEY_EDIT */
207 /* 177 */ SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLUP */
208 /* 178 */ SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLDOWN */
209 /* 179 */ SDL_SCANCODE_KP_LEFTPAREN,
210 /* 180 */ SDL_SCANCODE_KP_RIGHTPAREN,
211 /* 181 */ SDL_SCANCODE_UNKNOWN, /* KEY_NEW */
212 /* 182 */ SDL_SCANCODE_UNKNOWN, /* KEY_REDO */
213 /* 183 */ SDL_SCANCODE_F13,
214 /* 184 */ SDL_SCANCODE_F14,
215 /* 185 */ SDL_SCANCODE_F15,
216 /* 186 */ SDL_SCANCODE_F16,
217 /* 187 */ SDL_SCANCODE_F17,
218 /* 188 */ SDL_SCANCODE_F18,
219 /* 189 */ SDL_SCANCODE_F19,
220 /* 190 */ SDL_SCANCODE_F20,
221 /* 191 */ SDL_SCANCODE_F21,
222 /* 192 */ SDL_SCANCODE_F22,
223 /* 193 */ SDL_SCANCODE_F23,
224 /* 194 */ SDL_SCANCODE_F24,
225 0, 0, 0, 0,
226 /* 200 */ SDL_SCANCODE_UNKNOWN, /* KEY_PLAYCD */
227 /* 201 */ SDL_SCANCODE_UNKNOWN, /* KEY_PAUSECD */
228 /* 202 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG3 */
229 /* 203 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG4 */
230 0,
231 /* 205 */ SDL_SCANCODE_UNKNOWN, /* KEY_SUSPEND */
232 /* 206 */ SDL_SCANCODE_UNKNOWN, /* KEY_CLOSE */
233 /* 207 */ SDL_SCANCODE_UNKNOWN, /* KEY_PLAY */
234 /* 208 */ SDL_SCANCODE_UNKNOWN, /* KEY_FASTFORWARD */
235 /* 209 */ SDL_SCANCODE_UNKNOWN, /* KEY_BASSBOOST */
236 /* 210 */ SDL_SCANCODE_UNKNOWN, /* KEY_PRINT */
237 /* 211 */ SDL_SCANCODE_UNKNOWN, /* KEY_HP */
238 /* 212 */ SDL_SCANCODE_UNKNOWN, /* KEY_CAMERA */
239 /* 213 */ SDL_SCANCODE_UNKNOWN, /* KEY_SOUND */
240 /* 214 */ SDL_SCANCODE_UNKNOWN, /* KEY_QUESTION */
241 /* 215 */ SDL_SCANCODE_UNKNOWN, /* KEY_EMAIL */
242 /* 216 */ SDL_SCANCODE_UNKNOWN, /* KEY_CHAT */
243 /* 217 */ SDL_SCANCODE_AC_SEARCH,
244 /* 218 */ SDL_SCANCODE_UNKNOWN, /* KEY_CONNECT */
245 /* 219 */ SDL_SCANCODE_UNKNOWN, /* KEY_FINANCE */
246 /* 220 */ SDL_SCANCODE_UNKNOWN, /* KEY_SPORT */
247 /* 221 */ SDL_SCANCODE_UNKNOWN, /* KEY_SHOP */
248 /* 222 */ SDL_SCANCODE_ALTERASE,
249 /* 223 */ SDL_SCANCODE_CANCEL,
250 /* 224 */ SDL_SCANCODE_BRIGHTNESSDOWN,
251 /* 225 */ SDL_SCANCODE_BRIGHTNESSUP,
252 /* 226 */ SDL_SCANCODE_UNKNOWN, /* KEY_MEDIA */
253 /* 227 */ SDL_SCANCODE_DISPLAYSWITCH, /* KEY_SWITCHVIDEOMODE */
254 /* 228 */ SDL_SCANCODE_KBDILLUMTOGGLE,
255 /* 229 */ SDL_SCANCODE_KBDILLUMDOWN,
256 /* 230 */ SDL_SCANCODE_KBDILLUMUP,
257 /* 231 */ SDL_SCANCODE_UNKNOWN, /* KEY_SEND */
258 /* 232 */ SDL_SCANCODE_UNKNOWN, /* KEY_REPLY */
259 /* 233 */ SDL_SCANCODE_UNKNOWN, /* KEY_FORWARDMAIL */
260 /* 234 */ SDL_SCANCODE_UNKNOWN, /* KEY_SAVE */
261 /* 235 */ SDL_SCANCODE_UNKNOWN, /* KEY_DOCUMENTS */
262 /* 236 */ SDL_SCANCODE_UNKNOWN, /* KEY_BATTERY */
263 };
264 /* *INDENT-ON* */