forked from SteveMaddison/cabrio
-
Notifications
You must be signed in to change notification settings - Fork 4
/
key.c
403 lines (399 loc) · 19.4 KB
/
key.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
#include "key.h"
#include <SDL2/SDL.h>
/* Big list o' key names. These are just the SDLK_* macros with their prefix chopped off. */
static const char *key_name_backspace = "backspace";
static const char *key_name_tab = "tab";
static const char *key_name_clear = "clear";
static const char *key_name_return = "return";
static const char *key_name_pause = "pause";
static const char *key_name_escape = "escape";
static const char *key_name_space = "space";
static const char *key_name_exclaim = "exclaim";
static const char *key_name_quotedbl = "quotedbl";
static const char *key_name_hash = "hash";
static const char *key_name_dollar = "dollar";
static const char *key_name_ampersand = "ampersand";
static const char *key_name_quote = "quote";
static const char *key_name_leftparen = "leftparen";
static const char *key_name_rightparen = "rightparen";
static const char *key_name_asterisk = "asterisk";
static const char *key_name_plus = "plus";
static const char *key_name_comma = "comma";
static const char *key_name_minus = "minus";
static const char *key_name_period = "period";
static const char *key_name_slash = "slash";
static const char *key_name_0 = "0";
static const char *key_name_1 = "1";
static const char *key_name_2 = "2";
static const char *key_name_3 = "3";
static const char *key_name_4 = "4";
static const char *key_name_5 = "5";
static const char *key_name_6 = "6";
static const char *key_name_7 = "7";
static const char *key_name_8 = "8";
static const char *key_name_9 = "9";
static const char *key_name_colon = "colon";
static const char *key_name_semicolon = "semicolon";
static const char *key_name_less = "less";
static const char *key_name_equals = "equals";
static const char *key_name_greater = "greater";
static const char *key_name_question = "question";
static const char *key_name_at = "at";
static const char *key_name_leftbracket = "leftbracket";
static const char *key_name_backslash = "backslash";
static const char *key_name_rightbracket = "rightbracket";
static const char *key_name_caret = "caret";
static const char *key_name_underscore = "underscore";
static const char *key_name_backquote = "backquote";
static const char *key_name_a = "a";
static const char *key_name_b = "b";
static const char *key_name_c = "c";
static const char *key_name_d = "d";
static const char *key_name_e = "e";
static const char *key_name_f = "f";
static const char *key_name_g = "g";
static const char *key_name_h = "h";
static const char *key_name_i = "i";
static const char *key_name_j = "j";
static const char *key_name_k = "k";
static const char *key_name_l = "l";
static const char *key_name_m = "m";
static const char *key_name_n = "n";
static const char *key_name_o = "o";
static const char *key_name_p = "p";
static const char *key_name_q = "q";
static const char *key_name_r = "r";
static const char *key_name_s = "s";
static const char *key_name_t = "t";
static const char *key_name_u = "u";
static const char *key_name_v = "v";
static const char *key_name_w = "w";
static const char *key_name_x = "x";
static const char *key_name_y = "y";
static const char *key_name_z = "z";
static const char *key_name_delete = "delete";
static const char *key_name_kp_0 = "kp_0";
static const char *key_name_kp_1 = "kp_1";
static const char *key_name_kp_2 = "kp_2";
static const char *key_name_kp_3 = "kp_3";
static const char *key_name_kp_4 = "kp_4";
static const char *key_name_kp_5 = "kp_5";
static const char *key_name_kp_6 = "kp_6";
static const char *key_name_kp_7 = "kp_7";
static const char *key_name_kp_8 = "kp_8";
static const char *key_name_kp_9 = "kp_9";
static const char *key_name_kp_period = "kp_period";
static const char *key_name_kp_divide = "kp_divide";
static const char *key_name_kp_multiply = "kp_multiply";
static const char *key_name_kp_minus = "kp_minus";
static const char *key_name_kp_plus = "kp_plus";
static const char *key_name_kp_enter = "kp_enter";
static const char *key_name_kp_equals = "kp_equals";
static const char *key_name_up = "up";
static const char *key_name_down = "down";
static const char *key_name_right = "right";
static const char *key_name_left = "left";
static const char *key_name_insert = "insert";
static const char *key_name_home = "home";
static const char *key_name_end = "end";
static const char *key_name_pageup = "pageup";
static const char *key_name_pagedown = "pagedown";
static const char *key_name_f1 = "f1";
static const char *key_name_f2 = "f2";
static const char *key_name_f3 = "f3";
static const char *key_name_f4 = "f4";
static const char *key_name_f5 = "f5";
static const char *key_name_f6 = "f6";
static const char *key_name_f7 = "f7";
static const char *key_name_f8 = "f8";
static const char *key_name_f9 = "f9";
static const char *key_name_f10 = "f10";
static const char *key_name_f11 = "f11";
static const char *key_name_f12 = "f12";
static const char *key_name_f13 = "f13";
static const char *key_name_f14 = "f14";
static const char *key_name_f15 = "f15";
static const char *key_name_numlockclear = "numlockclear";
static const char *key_name_capslock = "capslock";
static const char *key_name_scrolllock = "scrolllock";
static const char *key_name_rshift = "rshift";
static const char *key_name_lshift = "lshift";
static const char *key_name_rctrl = "rctrl";
static const char *key_name_lctrl = "lctrl";
static const char *key_name_ralt = "ralt";
static const char *key_name_lalt = "lalt";
static const char *key_name_mode = "mode";
static const char *key_name_help = "help";
static const char *key_name_printscreen = "printscreen";
static const char *key_name_sysreq = "sysreq";
static const char *key_name_menu = "menu";
static const char *key_name_power = "power";
static const char *key_name_undo = "undo";
int key_id( char *name ) {
if( name == NULL ) {
fprintf( stderr, "Warning: Null key name\n" );
return -1;
}
if( strcasecmp( name, key_name_backspace ) == 0 )return SDLK_BACKSPACE;
else if( strcasecmp( name, key_name_tab ) == 0 )return SDLK_TAB;
else if( strcasecmp( name, key_name_clear ) == 0 )return SDLK_CLEAR;
else if( strcasecmp( name, key_name_return ) == 0 )return SDLK_RETURN;
else if( strcasecmp( name, key_name_pause ) == 0 )return SDLK_PAUSE;
else if( strcasecmp( name, key_name_escape ) == 0 )return SDLK_ESCAPE;
else if( strcasecmp( name, key_name_space ) == 0 )return SDLK_SPACE;
else if( strcasecmp( name, key_name_exclaim ) == 0 )return SDLK_EXCLAIM;
else if( strcasecmp( name, key_name_quotedbl ) == 0 )return SDLK_QUOTEDBL;
else if( strcasecmp( name, key_name_hash ) == 0 )return SDLK_HASH;
else if( strcasecmp( name, key_name_dollar ) == 0 )return SDLK_DOLLAR;
else if( strcasecmp( name, key_name_ampersand ) == 0 )return SDLK_AMPERSAND;
else if( strcasecmp( name, key_name_quote ) == 0 )return SDLK_QUOTE;
else if( strcasecmp( name, key_name_leftparen ) == 0 )return SDLK_LEFTPAREN;
else if( strcasecmp( name, key_name_rightparen ) == 0 )return SDLK_RIGHTPAREN;
else if( strcasecmp( name, key_name_asterisk ) == 0 )return SDLK_ASTERISK;
else if( strcasecmp( name, key_name_plus ) == 0 )return SDLK_PLUS;
else if( strcasecmp( name, key_name_comma ) == 0 )return SDLK_COMMA;
else if( strcasecmp( name, key_name_minus ) == 0 )return SDLK_MINUS;
else if( strcasecmp( name, key_name_period ) == 0 )return SDLK_PERIOD;
else if( strcasecmp( name, key_name_slash ) == 0 )return SDLK_SLASH;
else if( strcasecmp( name, key_name_0 ) == 0 )return SDLK_0;
else if( strcasecmp( name, key_name_1 ) == 0 )return SDLK_1;
else if( strcasecmp( name, key_name_2 ) == 0 )return SDLK_2;
else if( strcasecmp( name, key_name_3 ) == 0 )return SDLK_3;
else if( strcasecmp( name, key_name_4 ) == 0 )return SDLK_4;
else if( strcasecmp( name, key_name_5 ) == 0 )return SDLK_5;
else if( strcasecmp( name, key_name_6 ) == 0 )return SDLK_6;
else if( strcasecmp( name, key_name_7 ) == 0 )return SDLK_7;
else if( strcasecmp( name, key_name_8 ) == 0 )return SDLK_8;
else if( strcasecmp( name, key_name_9 ) == 0 )return SDLK_9;
else if( strcasecmp( name, key_name_colon ) == 0 )return SDLK_COLON;
else if( strcasecmp( name, key_name_semicolon ) == 0 )return SDLK_SEMICOLON;
else if( strcasecmp( name, key_name_less ) == 0 )return SDLK_LESS;
else if( strcasecmp( name, key_name_equals ) == 0 )return SDLK_EQUALS;
else if( strcasecmp( name, key_name_greater ) == 0 )return SDLK_GREATER;
else if( strcasecmp( name, key_name_question ) == 0 )return SDLK_QUESTION;
else if( strcasecmp( name, key_name_at ) == 0 )return SDLK_AT;
else if( strcasecmp( name, key_name_leftbracket ) == 0 )return SDLK_LEFTBRACKET;
else if( strcasecmp( name, key_name_backslash ) == 0 )return SDLK_BACKSLASH;
else if( strcasecmp( name, key_name_rightbracket ) == 0 )return SDLK_RIGHTBRACKET;
else if( strcasecmp( name, key_name_caret ) == 0 )return SDLK_CARET;
else if( strcasecmp( name, key_name_underscore ) == 0 )return SDLK_UNDERSCORE;
else if( strcasecmp( name, key_name_backquote ) == 0 )return SDLK_BACKQUOTE;
else if( strcasecmp( name, key_name_a ) == 0 )return SDLK_a;
else if( strcasecmp( name, key_name_b ) == 0 )return SDLK_b;
else if( strcasecmp( name, key_name_c ) == 0 )return SDLK_c;
else if( strcasecmp( name, key_name_d ) == 0 )return SDLK_d;
else if( strcasecmp( name, key_name_e ) == 0 )return SDLK_e;
else if( strcasecmp( name, key_name_f ) == 0 )return SDLK_f;
else if( strcasecmp( name, key_name_g ) == 0 )return SDLK_g;
else if( strcasecmp( name, key_name_h ) == 0 )return SDLK_h;
else if( strcasecmp( name, key_name_i ) == 0 )return SDLK_i;
else if( strcasecmp( name, key_name_j ) == 0 )return SDLK_j;
else if( strcasecmp( name, key_name_k ) == 0 )return SDLK_k;
else if( strcasecmp( name, key_name_l ) == 0 )return SDLK_l;
else if( strcasecmp( name, key_name_m ) == 0 )return SDLK_m;
else if( strcasecmp( name, key_name_n ) == 0 )return SDLK_n;
else if( strcasecmp( name, key_name_o ) == 0 )return SDLK_o;
else if( strcasecmp( name, key_name_p ) == 0 )return SDLK_p;
else if( strcasecmp( name, key_name_q ) == 0 )return SDLK_q;
else if( strcasecmp( name, key_name_r ) == 0 )return SDLK_r;
else if( strcasecmp( name, key_name_s ) == 0 )return SDLK_s;
else if( strcasecmp( name, key_name_t ) == 0 )return SDLK_t;
else if( strcasecmp( name, key_name_u ) == 0 )return SDLK_u;
else if( strcasecmp( name, key_name_v ) == 0 )return SDLK_v;
else if( strcasecmp( name, key_name_w ) == 0 )return SDLK_w;
else if( strcasecmp( name, key_name_x ) == 0 )return SDLK_x;
else if( strcasecmp( name, key_name_y ) == 0 )return SDLK_y;
else if( strcasecmp( name, key_name_z ) == 0 )return SDLK_z;
else if( strcasecmp( name, key_name_delete ) == 0 )return SDLK_DELETE;
else if( strcasecmp( name, key_name_kp_0 ) == 0 )return SDLK_KP_0;
else if( strcasecmp( name, key_name_kp_1 ) == 0 )return SDLK_KP_1;
else if( strcasecmp( name, key_name_kp_2 ) == 0 )return SDLK_KP_2;
else if( strcasecmp( name, key_name_kp_3 ) == 0 )return SDLK_KP_3;
else if( strcasecmp( name, key_name_kp_4 ) == 0 )return SDLK_KP_4;
else if( strcasecmp( name, key_name_kp_5 ) == 0 )return SDLK_KP_5;
else if( strcasecmp( name, key_name_kp_6 ) == 0 )return SDLK_KP_6;
else if( strcasecmp( name, key_name_kp_7 ) == 0 )return SDLK_KP_7;
else if( strcasecmp( name, key_name_kp_8 ) == 0 )return SDLK_KP_8;
else if( strcasecmp( name, key_name_kp_9 ) == 0 )return SDLK_KP_9;
else if( strcasecmp( name, key_name_kp_period ) == 0 )return SDLK_KP_PERIOD;
else if( strcasecmp( name, key_name_kp_divide ) == 0 )return SDLK_KP_DIVIDE;
else if( strcasecmp( name, key_name_kp_multiply ) == 0 )return SDLK_KP_MULTIPLY;
else if( strcasecmp( name, key_name_kp_minus ) == 0 )return SDLK_KP_MINUS;
else if( strcasecmp( name, key_name_kp_plus ) == 0 )return SDLK_KP_PLUS;
else if( strcasecmp( name, key_name_kp_enter ) == 0 )return SDLK_KP_ENTER;
else if( strcasecmp( name, key_name_kp_equals ) == 0 )return SDLK_KP_EQUALS;
else if( strcasecmp( name, key_name_up ) == 0 )return SDLK_UP;
else if( strcasecmp( name, key_name_down ) == 0 )return SDLK_DOWN;
else if( strcasecmp( name, key_name_right ) == 0 )return SDLK_RIGHT;
else if( strcasecmp( name, key_name_left ) == 0 )return SDLK_LEFT;
else if( strcasecmp( name, key_name_insert ) == 0 )return SDLK_INSERT;
else if( strcasecmp( name, key_name_home ) == 0 )return SDLK_HOME;
else if( strcasecmp( name, key_name_end ) == 0 )return SDLK_END;
else if( strcasecmp( name, key_name_pageup ) == 0 )return SDLK_PAGEUP;
else if( strcasecmp( name, key_name_pagedown ) == 0 )return SDLK_PAGEDOWN;
else if( strcasecmp( name, key_name_f1 ) == 0 )return SDLK_F1;
else if( strcasecmp( name, key_name_f2 ) == 0 )return SDLK_F2;
else if( strcasecmp( name, key_name_f3 ) == 0 )return SDLK_F3;
else if( strcasecmp( name, key_name_f4 ) == 0 )return SDLK_F4;
else if( strcasecmp( name, key_name_f5 ) == 0 )return SDLK_F5;
else if( strcasecmp( name, key_name_f6 ) == 0 )return SDLK_F6;
else if( strcasecmp( name, key_name_f7 ) == 0 )return SDLK_F7;
else if( strcasecmp( name, key_name_f8 ) == 0 )return SDLK_F8;
else if( strcasecmp( name, key_name_f9 ) == 0 )return SDLK_F9;
else if( strcasecmp( name, key_name_f10 ) == 0 )return SDLK_F10;
else if( strcasecmp( name, key_name_f11 ) == 0 )return SDLK_F11;
else if( strcasecmp( name, key_name_f12 ) == 0 )return SDLK_F12;
else if( strcasecmp( name, key_name_f13 ) == 0 )return SDLK_F13;
else if( strcasecmp( name, key_name_f14 ) == 0 )return SDLK_F14;
else if( strcasecmp( name, key_name_f15 ) == 0 )return SDLK_F15;
else if( strcasecmp( name, key_name_numlockclear ) == 0 )return SDLK_NUMLOCKCLEAR;
else if( strcasecmp( name, key_name_capslock ) == 0 )return SDLK_CAPSLOCK;
else if( strcasecmp( name, key_name_scrolllock ) == 0 )return SDLK_SCROLLLOCK;
else if( strcasecmp( name, key_name_rshift ) == 0 )return SDLK_RSHIFT;
else if( strcasecmp( name, key_name_lshift ) == 0 )return SDLK_LSHIFT;
else if( strcasecmp( name, key_name_rctrl ) == 0 )return SDLK_RCTRL;
else if( strcasecmp( name, key_name_lctrl ) == 0 )return SDLK_LCTRL;
else if( strcasecmp( name, key_name_ralt ) == 0 )return SDLK_RALT;
else if( strcasecmp( name, key_name_lalt ) == 0 )return SDLK_LALT;
else if( strcasecmp( name, key_name_mode ) == 0 )return SDLK_MODE;
else if( strcasecmp( name, key_name_help ) == 0 )return SDLK_HELP;
else if( strcasecmp( name, key_name_printscreen ) == 0 )return SDLK_PRINTSCREEN;
else if( strcasecmp( name, key_name_sysreq ) == 0 )return SDLK_SYSREQ;
else if( strcasecmp( name, key_name_menu ) == 0 )return SDLK_MENU;
else if( strcasecmp( name, key_name_power ) == 0 )return SDLK_POWER;
else if( strcasecmp( name, key_name_undo ) == 0 )return SDLK_UNDO;
return 0;
}
const char *key_name( int key ) {
switch( key ) {
case SDLK_BACKSPACE: return key_name_backspace;
case SDLK_TAB: return key_name_tab;
case SDLK_CLEAR: return key_name_clear;
case SDLK_RETURN: return key_name_return;
case SDLK_PAUSE: return key_name_pause;
case SDLK_ESCAPE: return key_name_escape;
case SDLK_SPACE: return key_name_space;
case SDLK_EXCLAIM: return key_name_exclaim;
case SDLK_QUOTEDBL: return key_name_quotedbl;
case SDLK_HASH: return key_name_hash;
case SDLK_DOLLAR: return key_name_dollar;
case SDLK_AMPERSAND: return key_name_ampersand;
case SDLK_QUOTE: return key_name_quote;
case SDLK_LEFTPAREN: return key_name_leftparen;
case SDLK_RIGHTPAREN: return key_name_rightparen;
case SDLK_ASTERISK: return key_name_asterisk;
case SDLK_PLUS: return key_name_plus;
case SDLK_COMMA: return key_name_comma;
case SDLK_MINUS: return key_name_minus;
case SDLK_PERIOD: return key_name_period;
case SDLK_SLASH: return key_name_slash;
case SDLK_0: return key_name_0;
case SDLK_1: return key_name_1;
case SDLK_2: return key_name_2;
case SDLK_3: return key_name_3;
case SDLK_4: return key_name_4;
case SDLK_5: return key_name_5;
case SDLK_6: return key_name_6;
case SDLK_7: return key_name_7;
case SDLK_8: return key_name_8;
case SDLK_9: return key_name_9;
case SDLK_COLON: return key_name_colon;
case SDLK_SEMICOLON: return key_name_semicolon;
case SDLK_LESS: return key_name_less;
case SDLK_EQUALS: return key_name_equals;
case SDLK_GREATER: return key_name_greater;
case SDLK_QUESTION: return key_name_question;
case SDLK_AT: return key_name_at;
case SDLK_LEFTBRACKET: return key_name_leftbracket;
case SDLK_BACKSLASH: return key_name_backslash;
case SDLK_RIGHTBRACKET: return key_name_rightbracket;
case SDLK_CARET: return key_name_caret;
case SDLK_UNDERSCORE: return key_name_underscore;
case SDLK_BACKQUOTE: return key_name_backquote;
case SDLK_a: return key_name_a;
case SDLK_b: return key_name_b;
case SDLK_c: return key_name_c;
case SDLK_d: return key_name_d;
case SDLK_e: return key_name_e;
case SDLK_f: return key_name_f;
case SDLK_g: return key_name_g;
case SDLK_h: return key_name_h;
case SDLK_i: return key_name_i;
case SDLK_j: return key_name_j;
case SDLK_k: return key_name_k;
case SDLK_l: return key_name_l;
case SDLK_m: return key_name_m;
case SDLK_n: return key_name_n;
case SDLK_o: return key_name_o;
case SDLK_p: return key_name_p;
case SDLK_q: return key_name_q;
case SDLK_r: return key_name_r;
case SDLK_s: return key_name_s;
case SDLK_t: return key_name_t;
case SDLK_u: return key_name_u;
case SDLK_v: return key_name_v;
case SDLK_w: return key_name_w;
case SDLK_x: return key_name_x;
case SDLK_y: return key_name_y;
case SDLK_z: return key_name_z;
case SDLK_DELETE: return key_name_delete;
case SDLK_KP_0: return key_name_kp_0;
case SDLK_KP_1: return key_name_kp_1;
case SDLK_KP_2: return key_name_kp_2;
case SDLK_KP_3: return key_name_kp_3;
case SDLK_KP_4: return key_name_kp_4;
case SDLK_KP_5: return key_name_kp_5;
case SDLK_KP_6: return key_name_kp_6;
case SDLK_KP_7: return key_name_kp_7;
case SDLK_KP_8: return key_name_kp_8;
case SDLK_KP_9: return key_name_kp_9;
case SDLK_KP_PERIOD: return key_name_kp_period;
case SDLK_KP_DIVIDE: return key_name_kp_divide;
case SDLK_KP_MULTIPLY: return key_name_kp_multiply;
case SDLK_KP_MINUS: return key_name_kp_minus;
case SDLK_KP_PLUS: return key_name_kp_plus;
case SDLK_KP_ENTER: return key_name_kp_enter;
case SDLK_KP_EQUALS: return key_name_kp_equals;
case SDLK_UP: return key_name_up;
case SDLK_DOWN: return key_name_down;
case SDLK_RIGHT: return key_name_right;
case SDLK_LEFT: return key_name_left;
case SDLK_INSERT: return key_name_insert;
case SDLK_HOME: return key_name_home;
case SDLK_END: return key_name_end;
case SDLK_PAGEUP: return key_name_pageup;
case SDLK_PAGEDOWN: return key_name_pagedown;
case SDLK_F1: return key_name_f1;
case SDLK_F2: return key_name_f2;
case SDLK_F3: return key_name_f3;
case SDLK_F4: return key_name_f4;
case SDLK_F5: return key_name_f5;
case SDLK_F6: return key_name_f6;
case SDLK_F7: return key_name_f7;
case SDLK_F8: return key_name_f8;
case SDLK_F9: return key_name_f9;
case SDLK_F10: return key_name_f10;
case SDLK_F11: return key_name_f11;
case SDLK_F12: return key_name_f12;
case SDLK_F13: return key_name_f13;
case SDLK_F14: return key_name_f14;
case SDLK_F15: return key_name_f15;
case SDLK_NUMLOCKCLEAR: return key_name_numlockclear;
case SDLK_CAPSLOCK: return key_name_capslock;
case SDLK_SCROLLLOCK: return key_name_scrolllock;
case SDLK_RSHIFT: return key_name_rshift;
case SDLK_LSHIFT: return key_name_lshift;
case SDLK_RCTRL: return key_name_rctrl;
case SDLK_LCTRL: return key_name_lctrl;
case SDLK_RALT: return key_name_ralt;
case SDLK_LALT: return key_name_lalt;
case SDLK_MODE: return key_name_mode;
case SDLK_HELP: return key_name_help;
case SDLK_PRINTSCREEN: return key_name_printscreen;
case SDLK_SYSREQ: return key_name_sysreq;
case SDLK_MENU: return key_name_menu;
case SDLK_POWER: return key_name_power;
case SDLK_UNDO: return key_name_undo;
}
return NULL;
}