1 //from "sdl_scancode.h"
3 {**
4 * The SDL keyboard scancode representation.
5 *
6 * Values of this type are used to represent keyboard keys, among other places
7 * in the SDL_Keysym.scancode key.keysym.scancode \endlink field of the
8 * SDL_Event structure.
9 *
10 * The values in this enumeration are based on the USB usage page standard:
11 * http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf
12 *}
14 const
15 SDL_SCANCODE_UNKNOWN = 0;
17 {**
18 * Usage page $07
19 *
20 * These values are from usage page $07 (USB keyboard page).
21 *}
23 SDL_SCANCODE_A = 4;
24 SDL_SCANCODE_B = 5;
25 SDL_SCANCODE_C = 6;
26 SDL_SCANCODE_D = 7;
27 SDL_SCANCODE_E = 8;
28 SDL_SCANCODE_F = 9;
29 SDL_SCANCODE_G = 10;
30 SDL_SCANCODE_H = 11;
31 SDL_SCANCODE_I = 12;
32 SDL_SCANCODE_J = 13;
33 SDL_SCANCODE_K = 14;
34 SDL_SCANCODE_L = 15;
35 SDL_SCANCODE_M = 16;
36 SDL_SCANCODE_N = 17;
37 SDL_SCANCODE_O = 18;
38 SDL_SCANCODE_P = 19;
39 SDL_SCANCODE_Q = 20;
40 SDL_SCANCODE_R = 21;
41 SDL_SCANCODE_S = 22;
42 SDL_SCANCODE_T = 23;
43 SDL_SCANCODE_U = 24;
44 SDL_SCANCODE_V = 25;
45 SDL_SCANCODE_W = 26;
46 SDL_SCANCODE_X = 27;
47 SDL_SCANCODE_Y = 28;
48 SDL_SCANCODE_Z = 29;
50 SDL_SCANCODE_1 = 30;
51 SDL_SCANCODE_2 = 31;
52 SDL_SCANCODE_3 = 32;
53 SDL_SCANCODE_4 = 33;
54 SDL_SCANCODE_5 = 34;
55 SDL_SCANCODE_6 = 35;
56 SDL_SCANCODE_7 = 36;
57 SDL_SCANCODE_8 = 37;
58 SDL_SCANCODE_9 = 38;
59 SDL_SCANCODE_0 = 39;
61 SDL_SCANCODE_RETURN = 40;
62 SDL_SCANCODE_ESCAPE = 41;
63 SDL_SCANCODE_BACKSPACE = 42;
64 SDL_SCANCODE_TAB = 43;
65 SDL_SCANCODE_SPACE = 44;
67 SDL_SCANCODE_MINUS = 45;
68 SDL_SCANCODE_EQUALS = 46;
69 SDL_SCANCODE_LEFTBRACKET = 47;
70 SDL_SCANCODE_RIGHTBRACKET = 48;
71 SDL_SCANCODE_BACKSLASH = 49; {**< Located at the lower left of the return
72 * key on ISO keyboards and at the right end
73 * of the QWERTY row on ANSI keyboards.
74 * Produces REVERSE SOLIDUS (backslash) and
75 * VERTICAL LINE in a US layout; REVERSE
76 * SOLIDUS and VERTICAL LINE in a UK Mac
77 * layout; NUMBER SIGN and TILDE in a UK
78 * Windows layout; DOLLAR SIGN and POUND SIGN
79 * in a Swiss German layout; NUMBER SIGN and
80 * APOSTROPHE in a German layout; GRAVE
81 * ACCENT and POUND SIGN in a French Mac
82 * layout; and ASTERISK and MICRO SIGN in a
83 * French Windows layout.
84 *}
85 SDL_SCANCODE_NONUSHASH = 50; {**< ISO USB keyboards actually use this code
86 * instead of 49 for the same key; but all
87 * OSes I've seen treat the two codes
88 * identically. So; as an implementor; unless
89 * your keyboard generates both of those
90 * codes and your OS treats them differently;
91 * you should generate SDL_SCANCODE_BACKSLASH
92 * instead of this code. As a user; you
93 * should not rely on this code because SDL
94 * will never generate it with most (all?)
95 * keyboards.
96 *}
97 SDL_SCANCODE_SEMICOLON = 51;
98 SDL_SCANCODE_APOSTROPHE = 52;
99 SDL_SCANCODE_GRAVE = 53; {**< Located in the top left corner (on both ANSI
100 * and ISO keyboards). Produces GRAVE ACCENT and
101 * TILDE in a US Windows layout and in US and UK
102 * Mac layouts on ANSI keyboards; GRAVE ACCENT
103 * and NOT SIGN in a UK Windows layout; SECTION
104 * SIGN and PLUS-MINUS SIGN in US and UK Mac
105 * layouts on ISO keyboards; SECTION SIGN and
106 * DEGREE SIGN in a Swiss German layout (Mac:
107 * only on ISO keyboards); CIRCUMFLEX ACCENT and
108 * DEGREE SIGN in a German layout (Mac: only on
109 * ISO keyboards); SUPERSCRIPT TWO and TILDE in a
110 * French Windows layout; COMMERCIAL AT and
111 * NUMBER SIGN in a French Mac layout on ISO
112 * keyboards; and LESS-THAN SIGN and GREATER-THAN
113 * SIGN in a Swiss German; German; or French Mac
114 * layout on ANSI keyboards.
115 *}
116 SDL_SCANCODE_COMMA = 54;
117 SDL_SCANCODE_PERIOD = 55;
118 SDL_SCANCODE_SLASH = 56;
120 SDL_SCANCODE_CAPSLOCK = 57;
122 SDL_SCANCODE_F1 = 58;
123 SDL_SCANCODE_F2 = 59;
124 SDL_SCANCODE_F3 = 60;
125 SDL_SCANCODE_F4 = 61;
126 SDL_SCANCODE_F5 = 62;
127 SDL_SCANCODE_F6 = 63;
128 SDL_SCANCODE_F7 = 64;
129 SDL_SCANCODE_F8 = 65;
130 SDL_SCANCODE_F9 = 66;
131 SDL_SCANCODE_F10 = 67;
132 SDL_SCANCODE_F11 = 68;
133 SDL_SCANCODE_F12 = 69;
135 SDL_SCANCODE_PRINTSCREEN = 70;
136 SDL_SCANCODE_SCROLLLOCK = 71;
137 SDL_SCANCODE_PAUSE = 72;
138 SDL_SCANCODE_INSERT = 73; {**< insert on PC; help on some Mac keyboards (but
139 does send code 73; not 117) *}
140 SDL_SCANCODE_HOME = 74;
141 SDL_SCANCODE_PAGEUP = 75;
142 SDL_SCANCODE_DELETE = 76;
143 SDL_SCANCODE_END = 77;
144 SDL_SCANCODE_PAGEDOWN = 78;
145 SDL_SCANCODE_RIGHT = 79;
146 SDL_SCANCODE_LEFT = 80;
147 SDL_SCANCODE_DOWN = 81;
148 SDL_SCANCODE_UP = 82;
150 SDL_SCANCODE_NUMLOCKCLEAR = 83; {**< num lock on PC; clear on Mac keyboards
151 *}
152 SDL_SCANCODE_KP_DIVIDE = 84;
153 SDL_SCANCODE_KP_MULTIPLY = 85;
154 SDL_SCANCODE_KP_MINUS = 86;
155 SDL_SCANCODE_KP_PLUS = 87;
156 SDL_SCANCODE_KP_ENTER = 88;
157 SDL_SCANCODE_KP_1 = 89;
158 SDL_SCANCODE_KP_2 = 90;
159 SDL_SCANCODE_KP_3 = 91;
160 SDL_SCANCODE_KP_4 = 92;
161 SDL_SCANCODE_KP_5 = 93;
162 SDL_SCANCODE_KP_6 = 94;
163 SDL_SCANCODE_KP_7 = 95;
164 SDL_SCANCODE_KP_8 = 96;
165 SDL_SCANCODE_KP_9 = 97;
166 SDL_SCANCODE_KP_0 = 98;
167 SDL_SCANCODE_KP_PERIOD = 99;
169 SDL_SCANCODE_NONUSBACKSLASH = 100; {**< This is the additional key that ISO
170 * keyboards have over ANSI ones;
171 * located between left shift and Y.
172 * Produces GRAVE ACCENT and TILDE in a
173 * US or UK Mac layout; REVERSE SOLIDUS
174 * (backslash) and VERTICAL LINE in a
175 * US or UK Windows layout; and
176 * LESS-THAN SIGN and GREATER-THAN SIGN
177 * in a Swiss German; German; or French
178 * layout. *}
179 SDL_SCANCODE_APPLICATION = 101; {**< windows contextual menu; compose *}
180 SDL_SCANCODE_POWER = 102; {**< The USB document says this is a status flag;
181 * not a physical key - but some Mac keyboards
182 * do have a power key. *}
183 SDL_SCANCODE_KP_EQUALS = 103;
184 SDL_SCANCODE_F13 = 104;
185 SDL_SCANCODE_F14 = 105;
186 SDL_SCANCODE_F15 = 106;
187 SDL_SCANCODE_F16 = 107;
188 SDL_SCANCODE_F17 = 108;
189 SDL_SCANCODE_F18 = 109;
190 SDL_SCANCODE_F19 = 110;
191 SDL_SCANCODE_F20 = 111;
192 SDL_SCANCODE_F21 = 112;
193 SDL_SCANCODE_F22 = 113;
194 SDL_SCANCODE_F23 = 114;
195 SDL_SCANCODE_F24 = 115;
196 SDL_SCANCODE_EXECUTE = 116;
197 SDL_SCANCODE_HELP = 117;
198 SDL_SCANCODE_MENU = 118;
199 SDL_SCANCODE_SELECT = 119;
200 SDL_SCANCODE_STOP = 120;
201 SDL_SCANCODE_AGAIN = 121; {**< redo *}
202 SDL_SCANCODE_UNDO = 122;
203 SDL_SCANCODE_CUT = 123;
204 SDL_SCANCODE_COPY = 124;
205 SDL_SCANCODE_PASTE = 125;
206 SDL_SCANCODE_FIND = 126;
207 SDL_SCANCODE_MUTE = 127;
208 SDL_SCANCODE_VOLUMEUP = 128;
209 SDL_SCANCODE_VOLUMEDOWN = 129;
210 {* not sure whether there's a reason to enable these *}
211 {* SDL_SCANCODE_LOCKINGCAPSLOCK = 130; *}
212 {* SDL_SCANCODE_LOCKINGNUMLOCK = 131; *}
213 {* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132; *}
214 SDL_SCANCODE_KP_COMMA = 133;
215 SDL_SCANCODE_KP_EQUALSAS400 = 134;
217 SDL_SCANCODE_INTERNATIONAL1 = 135; {**< used on Asian keyboards; see footnotes in USB doc *}
218 SDL_SCANCODE_INTERNATIONAL2 = 136;
219 SDL_SCANCODE_INTERNATIONAL3 = 137; {**< Yen *}
220 SDL_SCANCODE_INTERNATIONAL4 = 138;
221 SDL_SCANCODE_INTERNATIONAL5 = 139;
222 SDL_SCANCODE_INTERNATIONAL6 = 140;
223 SDL_SCANCODE_INTERNATIONAL7 = 141;
224 SDL_SCANCODE_INTERNATIONAL8 = 142;
225 SDL_SCANCODE_INTERNATIONAL9 = 143;
226 SDL_SCANCODE_LANG1 = 144; {**< Hangul{English toggle *}
227 SDL_SCANCODE_LANG2 = 145; {**< Hanja conversion *}
228 SDL_SCANCODE_LANG3 = 146; {**< Katakana *}
229 SDL_SCANCODE_LANG4 = 147; {**< Hiragana *}
230 SDL_SCANCODE_LANG5 = 148; {**< Zenkaku{Hankaku *}
231 SDL_SCANCODE_LANG6 = 149; {**< reserved *}
232 SDL_SCANCODE_LANG7 = 150; {**< reserved *}
233 SDL_SCANCODE_LANG8 = 151; {**< reserved *}
234 SDL_SCANCODE_LANG9 = 152; {**< reserved *}
236 SDL_SCANCODE_ALTERASE = 153; {**< Erase-Eaze *}
237 SDL_SCANCODE_SYSREQ = 154;
238 SDL_SCANCODE_CANCEL = 155;
239 SDL_SCANCODE_CLEAR = 156;
240 SDL_SCANCODE_PRIOR = 157;
241 SDL_SCANCODE_RETURN2 = 158;
242 SDL_SCANCODE_SEPARATOR = 159;
243 SDL_SCANCODE_OUT = 160;
244 SDL_SCANCODE_OPER = 161;
245 SDL_SCANCODE_CLEARAGAIN = 162;
246 SDL_SCANCODE_CRSEL = 163;
247 SDL_SCANCODE_EXSEL = 164;
249 SDL_SCANCODE_KP_00 = 176;
250 SDL_SCANCODE_KP_000 = 177;
251 SDL_SCANCODE_THOUSANDSSEPARATOR = 178;
252 SDL_SCANCODE_DECIMALSEPARATOR = 179;
253 SDL_SCANCODE_CURRENCYUNIT = 180;
254 SDL_SCANCODE_CURRENCYSUBUNIT = 181;
255 SDL_SCANCODE_KP_LEFTPAREN = 182;
256 SDL_SCANCODE_KP_RIGHTPAREN = 183;
257 SDL_SCANCODE_KP_LEFTBRACE = 184;
258 SDL_SCANCODE_KP_RIGHTBRACE = 185;
259 SDL_SCANCODE_KP_TAB = 186;
260 SDL_SCANCODE_KP_BACKSPACE = 187;
261 SDL_SCANCODE_KP_A = 188;
262 SDL_SCANCODE_KP_B = 189;
263 SDL_SCANCODE_KP_C = 190;
264 SDL_SCANCODE_KP_D = 191;
265 SDL_SCANCODE_KP_E = 192;
266 SDL_SCANCODE_KP_F = 193;
267 SDL_SCANCODE_KP_XOR = 194;
268 SDL_SCANCODE_KP_POWER = 195;
269 SDL_SCANCODE_KP_PERCENT = 196;
270 SDL_SCANCODE_KP_LESS = 197;
271 SDL_SCANCODE_KP_GREATER = 198;
272 SDL_SCANCODE_KP_AMPERSAND = 199;
273 SDL_SCANCODE_KP_DBLAMPERSAND = 200;
274 SDL_SCANCODE_KP_VERTICALBAR = 201;
275 SDL_SCANCODE_KP_DBLVERTICALBAR = 202;
276 SDL_SCANCODE_KP_COLON = 203;
277 SDL_SCANCODE_KP_HASH = 204;
278 SDL_SCANCODE_KP_SPACE = 205;
279 SDL_SCANCODE_KP_AT = 206;
280 SDL_SCANCODE_KP_EXCLAM = 207;
281 SDL_SCANCODE_KP_MEMSTORE = 208;
282 SDL_SCANCODE_KP_MEMRECALL = 209;
283 SDL_SCANCODE_KP_MEMCLEAR = 210;
284 SDL_SCANCODE_KP_MEMADD = 211;
285 SDL_SCANCODE_KP_MEMSUBTRACT = 212;
286 SDL_SCANCODE_KP_MEMMULTIPLY = 213;
287 SDL_SCANCODE_KP_MEMDIVIDE = 214;
288 SDL_SCANCODE_KP_PLUSMINUS = 215;
289 SDL_SCANCODE_KP_CLEAR = 216;
290 SDL_SCANCODE_KP_CLEARENTRY = 217;
291 SDL_SCANCODE_KP_BINARY = 218;
292 SDL_SCANCODE_KP_OCTAL = 219;
293 SDL_SCANCODE_KP_DECIMAL = 220;
294 SDL_SCANCODE_KP_HEXADECIMAL = 221;
296 SDL_SCANCODE_LCTRL = 224;
297 SDL_SCANCODE_LSHIFT = 225;
298 SDL_SCANCODE_LALT = 226; {**< alt; option *}
299 SDL_SCANCODE_LGUI = 227; {**< windows; command (apple); meta *}
300 SDL_SCANCODE_RCTRL = 228;
301 SDL_SCANCODE_RSHIFT = 229;
302 SDL_SCANCODE_RALT = 230; {**< alt gr; option *}
303 SDL_SCANCODE_RGUI = 231; {**< windows; command (apple); meta *}
305 SDL_SCANCODE_MODE = 257; {**< I'm not sure if this is really not covered
306 * by any of the above; but since there's a
307 * special KMOD_MODE for it I'm adding it here
308 *}
310 {*Usage page $07*}
312 {**
313 * Usage page $0C
314 *
315 * These values are mapped from usage page $0C (USB consumer page).
316 *}
318 SDL_SCANCODE_AUDIONEXT = 258;
319 SDL_SCANCODE_AUDIOPREV = 259;
320 SDL_SCANCODE_AUDIOSTOP = 260;
321 SDL_SCANCODE_AUDIOPLAY = 261;
322 SDL_SCANCODE_AUDIOMUTE = 262;
323 SDL_SCANCODE_MEDIASELECT = 263;
324 SDL_SCANCODE_WWW = 264;
325 SDL_SCANCODE_MAIL = 265;
326 SDL_SCANCODE_CALCULATOR = 266;
327 SDL_SCANCODE_COMPUTER = 267;
328 SDL_SCANCODE_AC_SEARCH = 268;
329 SDL_SCANCODE_AC_HOME = 269;
330 SDL_SCANCODE_AC_BACK = 270;
331 SDL_SCANCODE_AC_FORWARD = 271;
332 SDL_SCANCODE_AC_STOP = 272;
333 SDL_SCANCODE_AC_REFRESH = 273;
334 SDL_SCANCODE_AC_BOOKMARKS = 274;
336 {*Usage page $0C*}
338 {**
339 * Walther keys
340 *
341 * These are values that Christian Walther added (for mac keyboard?).
342 *}
344 SDL_SCANCODE_BRIGHTNESSDOWN = 275;
345 SDL_SCANCODE_BRIGHTNESSUP = 276;
346 SDL_SCANCODE_DISPLAYSWITCH = 277; {**< display mirroring{dual display
347 switch; video mode switch *}
348 SDL_SCANCODE_KBDILLUMTOGGLE = 278;
349 SDL_SCANCODE_KBDILLUMDOWN = 279;
350 SDL_SCANCODE_KBDILLUMUP = 280;
351 SDL_SCANCODE_EJECT = 281;
352 SDL_SCANCODE_SLEEP = 282;
354 SDL_SCANCODE_APP1 = 283;
355 SDL_SCANCODE_APP2 = 284;
357 {*Walther keys*}
359 {* Add any other keys here. *}
361 SDL_NUM_SCANCODES = 512; {**< not a key, just marks the number of scancodes
362 for array bounds *}
364 type
365 PSDL_ScanCode = ^TSDL_ScanCode;
366 TSDL_ScanCode = DWord;
368 //from "sdl_keycode.h"
370 {**
371 * The SDL virtual key representation.
372 *
373 * Values of this type are used to represent keyboard keys using the current
374 * layout of the keyboard. These values include Unicode values representing
375 * the unmodified character that would be generated by pressing the key, or
376 * an SDLK_* constant for those keys that do not generate characters.
377 *}
378 PSDL_KeyCode = ^TSDL_KeyCode;
379 TSDL_KeyCode = SInt32;
381 const
382 SDLK_SCANCODE_MASK = 1 shl 30;
384 SDLK_UNKNOWN = 0;
386 SDLK_RETURN = SInt32(#13); // C: '\r'
387 SDLK_ESCAPE = SInt32(#27); // C: '\033'
388 SDLK_BACKSPACE = SInt32(#8); // C: '\b'
389 SDLK_TAB = SInt32(#9); // C: '\t'
390 SDLK_SPACE = SInt32(' ');
391 SDLK_EXCLAIM = SInt32('!');
392 SDLK_QUOTEDBL = SInt32('"');
393 SDLK_HASH = SInt32('#');
394 SDLK_PERCENT = SInt32('%');
395 SDLK_DOLLAR = SInt32('$');
396 SDLK_AMPERSAND = SInt32('&');
397 SDLK_QUOTE = SInt32('\');
398 SDLK_LEFTPAREN = SInt32('(');
399 SDLK_RIGHTPAREN = SInt32(')');
400 SDLK_ASTERISK = SInt32('*');
401 SDLK_PLUS = SInt32('+');
402 SDLK_COMMA = SInt32(',');
403 SDLK_MINUS = SInt32('-');
404 SDLK_PERIOD = SInt32('.');
405 SDLK_SLASH = SInt32('/');
406 SDLK_0 = SInt32('0');
407 SDLK_1 = SInt32('1');
408 SDLK_2 = SInt32('2');
409 SDLK_3 = SInt32('3');
410 SDLK_4 = SInt32('4');
411 SDLK_5 = SInt32('5');
412 SDLK_6 = SInt32('6');
413 SDLK_7 = SInt32('7');
414 SDLK_8 = SInt32('8');
415 SDLK_9 = SInt32('9');
416 SDLK_COLON = SInt32(':');
417 SDLK_SEMICOLON = SInt32(';');
418 SDLK_LESS = SInt32('<');
419 SDLK_EQUALS = SInt32('=');
420 SDLK_GREATER = SInt32('>');
421 SDLK_QUESTION = SInt32('?');
422 SDLK_AT = SInt32('@');
423 {*
424 Skip uppercase letters
425 *}
426 SDLK_LEFTBRACKET = SInt32('[');
427 SDLK_BACKSLASH = SInt32('\');
428 SDLK_RIGHTBRACKET = SInt32(']');
429 SDLK_CARET = SInt32('^');
430 SDLK_UNDERSCORE = SInt32('_');
431 SDLK_BACKQUOTE = SInt32('`');
432 SDLK_a = SInt32('a');
433 SDLK_b = SInt32('b');
434 SDLK_c = SInt32('c');
435 SDLK_d = SInt32('d');
436 SDLK_e = SInt32('e');
437 SDLK_f = SInt32('f');
438 SDLK_g = SInt32('g');
439 SDLK_h = SInt32('h');
440 SDLK_i = SInt32('i');
441 SDLK_j = SInt32('j');
442 SDLK_k = SInt32('k');
443 SDLK_l = SInt32('l');
444 SDLK_m = SInt32('m');
445 SDLK_n = SInt32('n');
446 SDLK_o = SInt32('o');
447 SDLK_p = SInt32('p');
448 SDLK_q = SInt32('q');
449 SDLK_r = SInt32('r');
450 SDLK_s = SInt32('s');
451 SDLK_t = SInt32('t');
452 SDLK_u = SInt32('u');
453 SDLK_v = SInt32('v');
454 SDLK_w = SInt32('w');
455 SDLK_x = SInt32('x');
456 SDLK_y = SInt32('y');
457 SDLK_z = SInt32('z');
459 SDLK_CAPSLOCK = SDL_SCANCODE_CAPSLOCK or SDLK_SCANCODE_MASK;
461 SDLK_F1 = SDL_SCANCODE_F1 or SDLK_SCANCODE_MASK;
462 SDLK_F2 = SDL_SCANCODE_F2 or SDLK_SCANCODE_MASK;
463 SDLK_F3 = SDL_SCANCODE_F3 or SDLK_SCANCODE_MASK;
464 SDLK_F4 = SDL_SCANCODE_F4 or SDLK_SCANCODE_MASK;
465 SDLK_F5 = SDL_SCANCODE_F5 or SDLK_SCANCODE_MASK;
466 SDLK_F6 = SDL_SCANCODE_F6 or SDLK_SCANCODE_MASK;
467 SDLK_F7 = SDL_SCANCODE_F7 or SDLK_SCANCODE_MASK;
468 SDLK_F8 = SDL_SCANCODE_F8 or SDLK_SCANCODE_MASK;
469 SDLK_F9 = SDL_SCANCODE_F9 or SDLK_SCANCODE_MASK;
470 SDLK_F10 = SDL_SCANCODE_F10 or SDLK_SCANCODE_MASK;
471 SDLK_F11 = SDL_SCANCODE_F11 or SDLK_SCANCODE_MASK;
472 SDLK_F12 = SDL_SCANCODE_F12 or SDLK_SCANCODE_MASK;
474 SDLK_PRINTSCREEN = SDL_SCANCODE_PRINTSCREEN or SDLK_SCANCODE_MASK;
475 SDLK_SCROLLLOCK = SDL_SCANCODE_SCROLLLOCK or SDLK_SCANCODE_MASK;
476 SDLK_PAUSE = SDL_SCANCODE_PAUSE or SDLK_SCANCODE_MASK;
477 SDLK_INSERT = SDL_SCANCODE_INSERT or SDLK_SCANCODE_MASK;
478 SDLK_HOME = SDL_SCANCODE_HOME or SDLK_SCANCODE_MASK;
479 SDLK_PAGEUP = SDL_SCANCODE_PAGEUP or SDLK_SCANCODE_MASK;
480 SDLK_DELETE = SInt32(#127); // C: '\177'
481 SDLK_END = SDL_SCANCODE_END or SDLK_SCANCODE_MASK;
482 SDLK_PAGEDOWN = SDL_SCANCODE_PAGEDOWN or SDLK_SCANCODE_MASK;
483 SDLK_RIGHT = SDL_SCANCODE_RIGHT or SDLK_SCANCODE_MASK;
484 SDLK_LEFT = SDL_SCANCODE_LEFT or SDLK_SCANCODE_MASK;
485 SDLK_DOWN = SDL_SCANCODE_DOWN or SDLK_SCANCODE_MASK;
486 SDLK_UP = SDL_SCANCODE_UP or SDLK_SCANCODE_MASK;
488 SDLK_NUMLOCKCLEAR = SDL_SCANCODE_NUMLOCKCLEAR or SDLK_SCANCODE_MASK;
489 SDLK_KP_DIVIDE = SDL_SCANCODE_KP_DIVIDE or SDLK_SCANCODE_MASK;
490 SDLK_KP_MULTIPLY = SDL_SCANCODE_KP_MULTIPLY or SDLK_SCANCODE_MASK;
491 SDLK_KP_MINUS = SDL_SCANCODE_KP_MINUS or SDLK_SCANCODE_MASK;
492 SDLK_KP_PLUS = SDL_SCANCODE_KP_PLUS or SDLK_SCANCODE_MASK;
493 SDLK_KP_ENTER = SDL_SCANCODE_KP_ENTER or SDLK_SCANCODE_MASK;
494 SDLK_KP_1 = SDL_SCANCODE_KP_1 or SDLK_SCANCODE_MASK;
495 SDLK_KP_2 = SDL_SCANCODE_KP_2 or SDLK_SCANCODE_MASK;
496 SDLK_KP_3 = SDL_SCANCODE_KP_3 or SDLK_SCANCODE_MASK;
497 SDLK_KP_4 = SDL_SCANCODE_KP_4 or SDLK_SCANCODE_MASK;
498 SDLK_KP_5 = SDL_SCANCODE_KP_5 or SDLK_SCANCODE_MASK;
499 SDLK_KP_6 = SDL_SCANCODE_KP_6 or SDLK_SCANCODE_MASK;
500 SDLK_KP_7 = SDL_SCANCODE_KP_7 or SDLK_SCANCODE_MASK;
501 SDLK_KP_8 = SDL_SCANCODE_KP_8 or SDLK_SCANCODE_MASK;
502 SDLK_KP_9 = SDL_SCANCODE_KP_9 or SDLK_SCANCODE_MASK;
503 SDLK_KP_0 = SDL_SCANCODE_KP_0 or SDLK_SCANCODE_MASK;
504 SDLK_KP_PERIOD = SDL_SCANCODE_KP_PERIOD or SDLK_SCANCODE_MASK;
506 SDLK_APPLICATION = SDL_SCANCODE_APPLICATION or SDLK_SCANCODE_MASK;
507 SDLK_POWER = SDL_SCANCODE_POWER or SDLK_SCANCODE_MASK;
508 SDLK_KP_EQUALS = SDL_SCANCODE_KP_EQUALS or SDLK_SCANCODE_MASK;
509 SDLK_F13 = SDL_SCANCODE_F13 or SDLK_SCANCODE_MASK;
510 SDLK_F14 = SDL_SCANCODE_F14 or SDLK_SCANCODE_MASK;
511 SDLK_F15 = SDL_SCANCODE_F15 or SDLK_SCANCODE_MASK;
512 SDLK_F16 = SDL_SCANCODE_F16 or SDLK_SCANCODE_MASK;
513 SDLK_F17 = SDL_SCANCODE_F17 or SDLK_SCANCODE_MASK;
514 SDLK_F18 = SDL_SCANCODE_F18 or SDLK_SCANCODE_MASK;
515 SDLK_F19 = SDL_SCANCODE_F19 or SDLK_SCANCODE_MASK;
516 SDLK_F20 = SDL_SCANCODE_F20 or SDLK_SCANCODE_MASK;
517 SDLK_F21 = SDL_SCANCODE_F21 or SDLK_SCANCODE_MASK;
518 SDLK_F22 = SDL_SCANCODE_F22 or SDLK_SCANCODE_MASK;
519 SDLK_F23 = SDL_SCANCODE_F23 or SDLK_SCANCODE_MASK;
520 SDLK_F24 = SDL_SCANCODE_F24 or SDLK_SCANCODE_MASK;
521 SDLK_EXECUTE = SDL_SCANCODE_EXECUTE or SDLK_SCANCODE_MASK;
522 SDLK_HELP = SDL_SCANCODE_HELP or SDLK_SCANCODE_MASK;
523 SDLK_MENU = SDL_SCANCODE_MENU or SDLK_SCANCODE_MASK;
524 SDLK_SELECT = SDL_SCANCODE_SELECT or SDLK_SCANCODE_MASK;
525 SDLK_STOP = SDL_SCANCODE_STOP or SDLK_SCANCODE_MASK;
526 SDLK_AGAIN = SDL_SCANCODE_AGAIN or SDLK_SCANCODE_MASK;
527 SDLK_UNDO = SDL_SCANCODE_UNDO or SDLK_SCANCODE_MASK;
528 SDLK_CUT = SDL_SCANCODE_CUT or SDLK_SCANCODE_MASK;
529 SDLK_COPY = SDL_SCANCODE_COPY or SDLK_SCANCODE_MASK;
530 SDLK_PASTE = SDL_SCANCODE_PASTE or SDLK_SCANCODE_MASK;
531 SDLK_FIND = SDL_SCANCODE_FIND or SDLK_SCANCODE_MASK;
532 SDLK_MUTE = SDL_SCANCODE_MUTE or SDLK_SCANCODE_MASK;
533 SDLK_VOLUMEUP = SDL_SCANCODE_VOLUMEUP or SDLK_SCANCODE_MASK;
534 SDLK_VOLUMEDOWN = SDL_SCANCODE_VOLUMEDOWN or SDLK_SCANCODE_MASK;
535 SDLK_KP_COMMA = SDL_SCANCODE_KP_COMMA or SDLK_SCANCODE_MASK;
536 SDLK_KP_EQUALSAS400 = SDL_SCANCODE_KP_EQUALSAS400 or SDLK_SCANCODE_MASK;
538 SDLK_ALTERASE = SDL_SCANCODE_ALTERASE or SDLK_SCANCODE_MASK;
539 SDLK_SYSREQ = SDL_SCANCODE_SYSREQ or SDLK_SCANCODE_MASK;
540 SDLK_CANCEL = SDL_SCANCODE_CANCEL or SDLK_SCANCODE_MASK;
541 SDLK_CLEAR = SDL_SCANCODE_CLEAR or SDLK_SCANCODE_MASK;
542 SDLK_PRIOR = SDL_SCANCODE_PRIOR or SDLK_SCANCODE_MASK;
543 SDLK_RETURN2 = SDL_SCANCODE_RETURN2 or SDLK_SCANCODE_MASK;
544 SDLK_SEPARATOR = SDL_SCANCODE_SEPARATOR or SDLK_SCANCODE_MASK;
545 SDLK_OUT = SDL_SCANCODE_OUT or SDLK_SCANCODE_MASK;
546 SDLK_OPER = SDL_SCANCODE_OPER or SDLK_SCANCODE_MASK;
547 SDLK_CLEARAGAIN = SDL_SCANCODE_CLEARAGAIN or SDLK_SCANCODE_MASK;
548 SDLK_CRSEL = SDL_SCANCODE_CRSEL or SDLK_SCANCODE_MASK;
549 SDLK_EXSEL = SDL_SCANCODE_EXSEL or SDLK_SCANCODE_MASK;
551 SDLK_KP_00 = SDL_SCANCODE_KP_00 or SDLK_SCANCODE_MASK;
552 SDLK_KP_000 = SDL_SCANCODE_KP_000 or SDLK_SCANCODE_MASK;
553 SDLK_THOUSANDSSEPARATOR = SDL_SCANCODE_THOUSANDSSEPARATOR or SDLK_SCANCODE_MASK;
554 SDLK_DECIMALSEPARATOR = SDL_SCANCODE_DECIMALSEPARATOR or SDLK_SCANCODE_MASK;
555 SDLK_CURRENCYUNIT = SDL_SCANCODE_CURRENCYUNIT or SDLK_SCANCODE_MASK;
556 SDLK_CURRENCYSUBUNIT = SDL_SCANCODE_CURRENCYSUBUNIT or SDLK_SCANCODE_MASK;
557 SDLK_KP_LEFTPAREN = SDL_SCANCODE_KP_LEFTPAREN or SDLK_SCANCODE_MASK;
558 SDLK_KP_RIGHTPAREN = SDL_SCANCODE_KP_RIGHTPAREN or SDLK_SCANCODE_MASK;
559 SDLK_KP_LEFTBRACE = SDL_SCANCODE_KP_LEFTBRACE or SDLK_SCANCODE_MASK;
560 SDLK_KP_RIGHTBRACE = SDL_SCANCODE_KP_RIGHTBRACE or SDLK_SCANCODE_MASK;
561 SDLK_KP_TAB = SDL_SCANCODE_KP_TAB or SDLK_SCANCODE_MASK;
562 SDLK_KP_BACKSPACE = SDL_SCANCODE_KP_BACKSPACE or SDLK_SCANCODE_MASK;
563 SDLK_KP_A = SDL_SCANCODE_KP_A or SDLK_SCANCODE_MASK;
564 SDLK_KP_B = SDL_SCANCODE_KP_B or SDLK_SCANCODE_MASK;
565 SDLK_KP_C = SDL_SCANCODE_KP_C or SDLK_SCANCODE_MASK;
566 SDLK_KP_D = SDL_SCANCODE_KP_D or SDLK_SCANCODE_MASK;
567 SDLK_KP_E = SDL_SCANCODE_KP_E or SDLK_SCANCODE_MASK;
568 SDLK_KP_F = SDL_SCANCODE_KP_F or SDLK_SCANCODE_MASK;
569 SDLK_KP_XOR = SDL_SCANCODE_KP_XOR or SDLK_SCANCODE_MASK;
570 SDLK_KP_POWER = SDL_SCANCODE_KP_POWER or SDLK_SCANCODE_MASK;
571 SDLK_KP_PERCENT = SDL_SCANCODE_KP_PERCENT or SDLK_SCANCODE_MASK;
572 SDLK_KP_LESS = SDL_SCANCODE_KP_LESS or SDLK_SCANCODE_MASK;
573 SDLK_KP_GREATER = SDL_SCANCODE_KP_GREATER or SDLK_SCANCODE_MASK;
574 SDLK_KP_AMPERSAND = SDL_SCANCODE_KP_AMPERSAND or SDLK_SCANCODE_MASK;
575 SDLK_KP_DBLAMPERSAND = SDL_SCANCODE_KP_DBLAMPERSAND or SDLK_SCANCODE_MASK;
576 SDLK_KP_VERTICALBAR = SDL_SCANCODE_KP_VERTICALBAR or SDLK_SCANCODE_MASK;
577 SDLK_KP_DBLVERTICALBAR = SDL_SCANCODE_KP_DBLVERTICALBAR or SDLK_SCANCODE_MASK;
578 SDLK_KP_COLON = SDL_SCANCODE_KP_COLON or SDLK_SCANCODE_MASK;
579 SDLK_KP_HASH = SDL_SCANCODE_KP_HASH or SDLK_SCANCODE_MASK;
580 SDLK_KP_SPACE = SDL_SCANCODE_KP_SPACE or SDLK_SCANCODE_MASK;
581 SDLK_KP_AT = SDL_SCANCODE_KP_AT or SDLK_SCANCODE_MASK;
582 SDLK_KP_EXCLAM = SDL_SCANCODE_KP_EXCLAM or SDLK_SCANCODE_MASK;
583 SDLK_KP_MEMSTORE = SDL_SCANCODE_KP_MEMSTORE or SDLK_SCANCODE_MASK;
584 SDLK_KP_MEMRECALL = SDL_SCANCODE_KP_MEMRECALL or SDLK_SCANCODE_MASK;
585 SDLK_KP_MEMCLEAR = SDL_SCANCODE_KP_MEMCLEAR or SDLK_SCANCODE_MASK;
586 SDLK_KP_MEMADD = SDL_SCANCODE_KP_MEMADD or SDLK_SCANCODE_MASK;
587 SDLK_KP_MEMSUBTRACT = SDL_SCANCODE_KP_MEMSUBTRACT or SDLK_SCANCODE_MASK;
588 SDLK_KP_MEMMULTIPLY = SDL_SCANCODE_KP_MEMMULTIPLY or SDLK_SCANCODE_MASK;
589 SDLK_KP_MEMDIVIDE = SDL_SCANCODE_KP_MEMDIVIDE or SDLK_SCANCODE_MASK;
590 SDLK_KP_PLUSMINUS = SDL_SCANCODE_KP_PLUSMINUS or SDLK_SCANCODE_MASK;
591 SDLK_KP_CLEAR = SDL_SCANCODE_KP_CLEAR or SDLK_SCANCODE_MASK;
592 SDLK_KP_CLEARENTRY = SDL_SCANCODE_KP_CLEARENTRY or SDLK_SCANCODE_MASK;
593 SDLK_KP_BINARY = SDL_SCANCODE_KP_BINARY or SDLK_SCANCODE_MASK;
594 SDLK_KP_OCTAL = SDL_SCANCODE_KP_OCTAL or SDLK_SCANCODE_MASK;
595 SDLK_KP_DECIMAL = SDL_SCANCODE_KP_DECIMAL or SDLK_SCANCODE_MASK;
596 SDLK_KP_HEXADECIMAL = SDL_SCANCODE_KP_HEXADECIMAL or SDLK_SCANCODE_MASK;
598 SDLK_LCTRL = SDL_SCANCODE_LCTRL or SDLK_SCANCODE_MASK;
599 SDLK_LSHIFT = SDL_SCANCODE_LSHIFT or SDLK_SCANCODE_MASK;
600 SDLK_LALT = SDL_SCANCODE_LALT or SDLK_SCANCODE_MASK;
601 SDLK_LGUI = SDL_SCANCODE_LGUI or SDLK_SCANCODE_MASK;
602 SDLK_RCTRL = SDL_SCANCODE_RCTRL or SDLK_SCANCODE_MASK;
603 SDLK_RSHIFT = SDL_SCANCODE_RSHIFT or SDLK_SCANCODE_MASK;
604 SDLK_RALT = SDL_SCANCODE_RALT or SDLK_SCANCODE_MASK;
605 SDLK_RGUI = SDL_SCANCODE_RGUI or SDLK_SCANCODE_MASK;
607 SDLK_MODE = SDL_SCANCODE_MODE or SDLK_SCANCODE_MASK;
609 SDLK_AUDIONEXT = SDL_SCANCODE_AUDIONEXT or SDLK_SCANCODE_MASK;
610 SDLK_AUDIOPREV = SDL_SCANCODE_AUDIOPREV or SDLK_SCANCODE_MASK;
611 SDLK_AUDIOSTOP = SDL_SCANCODE_AUDIOSTOP or SDLK_SCANCODE_MASK;
612 SDLK_AUDIOPLAY = SDL_SCANCODE_AUDIOPLAY or SDLK_SCANCODE_MASK;
613 SDLK_AUDIOMUTE = SDL_SCANCODE_AUDIOMUTE or SDLK_SCANCODE_MASK;
614 SDLK_MEDIASELECT = SDL_SCANCODE_MEDIASELECT or SDLK_SCANCODE_MASK;
615 SDLK_WWW = SDL_SCANCODE_WWW or SDLK_SCANCODE_MASK;
616 SDLK_MAIL = SDL_SCANCODE_MAIL or SDLK_SCANCODE_MASK;
617 SDLK_CALCULATOR = SDL_SCANCODE_CALCULATOR or SDLK_SCANCODE_MASK;
618 SDLK_COMPUTER = SDL_SCANCODE_COMPUTER or SDLK_SCANCODE_MASK;
619 SDLK_AC_SEARCH = SDL_SCANCODE_AC_SEARCH or SDLK_SCANCODE_MASK;
620 SDLK_AC_HOME = SDL_SCANCODE_AC_HOME or SDLK_SCANCODE_MASK;
621 SDLK_AC_BACK = SDL_SCANCODE_AC_BACK or SDLK_SCANCODE_MASK;
622 SDLK_AC_FORWARD = SDL_SCANCODE_AC_FORWARD or SDLK_SCANCODE_MASK;
623 SDLK_AC_STOP = SDL_SCANCODE_AC_STOP or SDLK_SCANCODE_MASK;
624 SDLK_AC_REFRESH = SDL_SCANCODE_AC_REFRESH or SDLK_SCANCODE_MASK;
625 SDLK_AC_BOOKMARKS = SDL_SCANCODE_AC_BOOKMARKS or SDLK_SCANCODE_MASK;
627 SDLK_BRIGHTNESSDOWN = SDL_SCANCODE_BRIGHTNESSDOWN or SDLK_SCANCODE_MASK;
628 SDLK_BRIGHTNESSUP = SDL_SCANCODE_BRIGHTNESSUP or SDLK_SCANCODE_MASK;
629 SDLK_DISPLAYSWITCH = SDL_SCANCODE_DISPLAYSWITCH or SDLK_SCANCODE_MASK;
630 SDLK_KBDILLUMTOGGLE = SDL_SCANCODE_KBDILLUMTOGGLE or SDLK_SCANCODE_MASK;
631 SDLK_KBDILLUMDOWN = SDL_SCANCODE_KBDILLUMDOWN or SDLK_SCANCODE_MASK;
632 SDLK_KBDILLUMUP = SDL_SCANCODE_KBDILLUMUP or SDLK_SCANCODE_MASK;
633 SDLK_EJECT = SDL_SCANCODE_EJECT or SDLK_SCANCODE_MASK;
634 SDLK_SLEEP = SDL_SCANCODE_SLEEP or SDLK_SCANCODE_MASK;
636 {**
637 * Enumeration of valid key mods (possibly OR'd together).
638 *}
640 KMOD_NONE = $0000;
641 KMOD_LSHIFT = $0001;
642 KMOD_RSHIFT = $0002;
643 KMOD_LCTRL = $0040;
644 KMOD_RCTRL = $0080;
645 KMOD_LALT = $0100;
646 KMOD_RALT = $0200;
647 KMOD_LGUI = $0400;
648 KMOD_RGUI = $0800;
649 KMOD_NUM = $1000;
650 KMOD_CAPS = $2000;
651 KMOD_MODE = $4000;
652 KMOD_RESERVED = $8000;
654 type
655 PSDL_KeyMod = ^TSDL_KeyMod;
656 TSDL_KeyMod = Word;
658 const
659 KMOD_CTRL = KMOD_LCTRL or KMOD_RCTRL;
660 KMOD_SHIFT = KMOD_LSHIFT or KMOD_RSHIFT;
661 KMOD_ALT = KMOD_LALT or KMOD_RALT;
662 KMOD_GUI = KMOD_LGUI or KMOD_RGUI;