• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
3  * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
4  *
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
20  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef KeyboardCodes_h
30 #define KeyboardCodes_h
31 
32 
33 namespace WebCore {
34     // VK_LBUTTON (01) Left mouse button
35     // VK_RBUTTON (02) Right mouse button
36     // VK_CANCEL (03) Control-break processing
37     // VK_MBUTTON (04) Middle mouse button (three-button mouse)
38     // VK_XBUTTON1 (05)
39     // VK_XBUTTON2 (06)
40 
41     // VK_BACK (08) BACKSPACE key
42     const int VK_BACK = 0x08;
43 
44     // VK_TAB (09) TAB key
45     const int VK_TAB = 0x09;
46 
47     // VK_CLEAR (0C) CLEAR key
48     const int VK_CLEAR = 0x0C;
49 
50     // VK_RETURN (0D)
51     const int VK_RETURN = 0x0D;
52 
53     // VK_SHIFT (10) SHIFT key
54     const int VK_SHIFT = 0x10;
55 
56     // VK_CONTROL (11) CTRL key
57     const int VK_CONTROL = 0x11;
58 
59     // VK_MENU (12) ALT key
60     const int VK_MENU = 0x12;
61 
62     // VK_PAUSE (13) PAUSE key
63     const int VK_PAUSE = 0x13;
64 
65     // VK_CAPITAL (14) CAPS LOCK key
66     const int VK_CAPITAL = 0x14;
67 
68     // VK_KANA (15) Input Method Editor (IME) Kana mode
69     const int VK_KANA = 0x15;
70 
71     // VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
72     // VK_HANGUL (15) IME Hangul mode
73     const int VK_HANGUL = 0x15;
74 
75     // VK_JUNJA (17) IME Junja mode
76     const int VK_JUNJA = 0x17;
77 
78     // VK_FINAL (18) IME final mode
79     const int VK_FINAL = 0x18;
80 
81     // VK_HANJA (19) IME Hanja mode
82     const int VK_HANJA = 0x19;
83 
84     // VK_KANJI (19) IME Kanji mode
85     const int VK_KANJI = 0x19;
86 
87     // VK_ESCAPE (1B) ESC key
88     const int VK_ESCAPE = 0x1B;
89 
90     // VK_CONVERT (1C) IME convert
91     const int VK_CONVERT = 0x1C;
92 
93     // VK_NONCONVERT (1D) IME nonconvert
94     const int VK_NONCONVERT = 0x1D;
95 
96     // VK_ACCEPT (1E) IME accept
97     const int VK_ACCEPT = 0x1E;
98 
99     // VK_MODECHANGE (1F) IME mode change request
100     const int VK_MODECHANGE = 0x1F;
101 
102     // VK_SPACE (20) SPACEBAR
103     const int VK_SPACE = 0x20;
104 
105     // VK_PRIOR (21) PAGE UP key
106     const int VK_PRIOR = 0x21;
107 
108     // VK_NEXT (22) PAGE DOWN key
109     const int VK_NEXT = 0x22;
110 
111     // VK_END (23) END key
112     const int VK_END = 0x23;
113 
114     // VK_HOME (24) HOME key
115     const int VK_HOME = 0x24;
116 
117     // VK_LEFT (25) LEFT ARROW key
118     const int VK_LEFT = 0x25;
119 
120     // VK_UP (26) UP ARROW key
121     const int VK_UP = 0x26;
122 
123     // VK_RIGHT (27) RIGHT ARROW key
124     const int VK_RIGHT = 0x27;
125 
126     // VK_DOWN (28) DOWN ARROW key
127     const int VK_DOWN = 0x28;
128 
129     // VK_SELECT (29) SELECT key
130     const int VK_SELECT = 0x29;
131 
132     // VK_PRINT (2A) PRINT key
133     const int VK_PRINT = 0x2A;
134 
135     // VK_EXECUTE (2B) EXECUTE key
136     const int VK_EXECUTE = 0x2B;
137 
138     // VK_SNAPSHOT (2C) PRINT SCREEN key
139     const int VK_SNAPSHOT = 0x2C;
140 
141     // VK_INSERT (2D) INS key
142     const int VK_INSERT = 0x2D;
143 
144     // VK_DELETE (2E) DEL key
145     const int VK_DELETE = 0x2E;
146 
147     // VK_HELP (2F) HELP key
148     const int VK_HELP = 0x2F;
149 
150     // (30) 0 key
151     const int VK_0 = 0x30;
152 
153     // (31) 1 key
154     const int VK_1 = 0x31;
155 
156     // (32) 2 key
157     const int VK_2 = 0x32;
158 
159     // (33) 3 key
160     const int VK_3 = 0x33;
161 
162     // (34) 4 key
163     const int VK_4 = 0x34;
164 
165     // (35) 5 key;
166 
167     const int VK_5 = 0x35;
168 
169     // (36) 6 key
170     const int VK_6 = 0x36;
171 
172     // (37) 7 key
173     const int VK_7 = 0x37;
174 
175     // (38) 8 key
176     const int VK_8 = 0x38;
177 
178     // (39) 9 key
179     const int VK_9 = 0x39;
180 
181     // (41) A key
182     const int VK_A = 0x41;
183 
184     // (42) B key
185     const int VK_B = 0x42;
186 
187     // (43) C key
188     const int VK_C = 0x43;
189 
190     // (44) D key
191     const int VK_D = 0x44;
192 
193     // (45) E key
194     const int VK_E = 0x45;
195 
196     // (46) F key
197     const int VK_F = 0x46;
198 
199     // (47) G key
200     const int VK_G = 0x47;
201 
202     // (48) H key
203     const int VK_H = 0x48;
204 
205     // (49) I key
206     const int VK_I = 0x49;
207 
208     // (4A) J key
209     const int VK_J = 0x4A;
210 
211     // (4B) K key
212     const int VK_K = 0x4B;
213 
214     // (4C) L key
215     const int VK_L = 0x4C;
216 
217     // (4D) M key
218     const int VK_M = 0x4D;
219 
220     // (4E) N key
221     const int VK_N = 0x4E;
222 
223     // (4F) O key
224     const int VK_O = 0x4F;
225 
226     // (50) P key
227     const int VK_P = 0x50;
228 
229     // (51) Q key
230     const int VK_Q = 0x51;
231 
232     // (52) R key
233     const int VK_R = 0x52;
234 
235     // (53) S key
236     const int VK_S = 0x53;
237 
238     // (54) T key
239     const int VK_T = 0x54;
240 
241     // (55) U key
242     const int VK_U = 0x55;
243 
244     // (56) V key
245     const int VK_V = 0x56;
246 
247     // (57) W key
248     const int VK_W = 0x57;
249 
250     // (58) X key
251     const int VK_X = 0x58;
252 
253     // (59) Y key
254     const int VK_Y = 0x59;
255 
256     // (5A) Z key
257     const int VK_Z = 0x5A;
258 
259     // VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
260     const int VK_LWIN = 0x5B;
261 
262     // VK_RWIN (5C) Right Windows key (Natural keyboard)
263     const int VK_RWIN = 0x5C;
264 
265     // VK_APPS (5D) Applications key (Natural keyboard)
266     const int VK_APPS = 0x5D;
267 
268     // VK_SLEEP (5F) Computer Sleep key
269     const int VK_SLEEP = 0x5F;
270 
271     // VK_NUMPAD0 (60) Numeric keypad 0 key
272     const int VK_NUMPAD0 = 0x60;
273 
274     // VK_NUMPAD1 (61) Numeric keypad 1 key
275     const int VK_NUMPAD1 = 0x61;
276 
277     // VK_NUMPAD2 (62) Numeric keypad 2 key
278     const int VK_NUMPAD2 = 0x62;
279 
280     // VK_NUMPAD3 (63) Numeric keypad 3 key
281     const int VK_NUMPAD3 = 0x63;
282 
283     // VK_NUMPAD4 (64) Numeric keypad 4 key
284     const int VK_NUMPAD4 = 0x64;
285 
286     // VK_NUMPAD5 (65) Numeric keypad 5 key
287     const int VK_NUMPAD5 = 0x65;
288 
289     // VK_NUMPAD6 (66) Numeric keypad 6 key
290     const int VK_NUMPAD6 = 0x66;
291 
292     // VK_NUMPAD7 (67) Numeric keypad 7 key
293     const int VK_NUMPAD7 = 0x67;
294 
295     // VK_NUMPAD8 (68) Numeric keypad 8 key
296     const int VK_NUMPAD8 = 0x68;
297 
298     // VK_NUMPAD9 (69) Numeric keypad 9 key
299     const int VK_NUMPAD9 = 0x69;
300 
301     // VK_MULTIPLY (6A) Multiply key
302     const int VK_MULTIPLY = 0x6A;
303 
304     // VK_ADD (6B) Add key
305     const int VK_ADD = 0x6B;
306 
307     // VK_SEPARATOR (6C) Separator key
308     const int VK_SEPARATOR = 0x6C;
309 
310     // VK_SUBTRACT (6D) Subtract key
311     const int VK_SUBTRACT = 0x6D;
312 
313     // VK_DECIMAL (6E) Decimal key
314     const int VK_DECIMAL = 0x6E;
315 
316     // VK_DIVIDE (6F) Divide key
317     const int VK_DIVIDE = 0x6F;
318 
319     // VK_F1 (70) F1 key
320     const int VK_F1 = 0x70;
321 
322     // VK_F2 (71) F2 key
323     const int VK_F2 = 0x71;
324 
325     // VK_F3 (72) F3 key
326     const int VK_F3 = 0x72;
327 
328     // VK_F4 (73) F4 key
329     const int VK_F4 = 0x73;
330 
331     // VK_F5 (74) F5 key
332     const int VK_F5 = 0x74;
333 
334     // VK_F6 (75) F6 key
335     const int VK_F6 = 0x75;
336 
337     // VK_F7 (76) F7 key
338     const int VK_F7 = 0x76;
339 
340     // VK_F8 (77) F8 key
341     const int VK_F8 = 0x77;
342 
343     // VK_F9 (78) F9 key
344     const int VK_F9 = 0x78;
345 
346     // VK_F10 (79) F10 key
347     const int VK_F10 = 0x79;
348 
349     // VK_F11 (7A) F11 key
350     const int VK_F11 = 0x7A;
351 
352     // VK_F12 (7B) F12 key
353     const int VK_F12 = 0x7B;
354 
355     // VK_F13 (7C) F13 key
356     const int VK_F13 = 0x7C;
357 
358     // VK_F14 (7D) F14 key
359     const int VK_F14 = 0x7D;
360 
361     // VK_F15 (7E) F15 key
362     const int VK_F15 = 0x7E;
363 
364     // VK_F16 (7F) F16 key
365     const int VK_F16 = 0x7F;
366 
367     // VK_F17 (80H) F17 key
368     const int VK_F17 = 0x80;
369 
370     // VK_F18 (81H) F18 key
371     const int VK_F18 = 0x81;
372 
373     // VK_F19 (82H) F19 key
374     const int VK_F19 = 0x82;
375 
376     // VK_F20 (83H) F20 key
377     const int VK_F20 = 0x83;
378 
379     // VK_F21 (84H) F21 key
380     const int VK_F21 = 0x84;
381 
382     // VK_F22 (85H) F22 key
383     const int VK_F22 = 0x85;
384 
385     // VK_F23 (86H) F23 key
386     const int VK_F23 = 0x86;
387 
388     // VK_F24 (87H) F24 key
389     const int VK_F24 = 0x87;
390 
391     // VK_NUMLOCK (90) NUM LOCK key
392     const int VK_NUMLOCK = 0x90;
393 
394     // VK_SCROLL (91) SCROLL LOCK key
395     const int VK_SCROLL = 0x91;
396 
397     // VK_LSHIFT (A0) Left SHIFT key
398     const int VK_LSHIFT = 0xA0;
399 
400     // VK_RSHIFT (A1) Right SHIFT key
401     const int VK_RSHIFT = 0xA1;
402 
403     // VK_LCONTROL (A2) Left CONTROL key
404     const int VK_LCONTROL = 0xA2;
405 
406     // VK_RCONTROL (A3) Right CONTROL key
407     const int VK_RCONTROL = 0xA3;
408 
409     // VK_LMENU (A4) Left MENU key
410     const int VK_LMENU = 0xA4;
411 
412     // VK_RMENU (A5) Right MENU key
413     const int VK_RMENU = 0xA5;
414 
415     // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
416     const int VK_BROWSER_BACK = 0xA6;
417 
418     // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
419     const int VK_BROWSER_FORWARD = 0xA7;
420 
421     // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
422     const int VK_BROWSER_REFRESH = 0xA8;
423 
424     // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
425     const int VK_BROWSER_STOP = 0xA9;
426 
427     // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
428     const int VK_BROWSER_SEARCH = 0xAA;
429 
430     // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
431     const int VK_BROWSER_FAVORITES = 0xAB;
432 
433     // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
434     const int VK_BROWSER_HOME = 0xAC;
435 
436     // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
437     const int VK_VOLUME_MUTE = 0xAD;
438 
439     // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
440     const int VK_VOLUME_DOWN = 0xAE;
441 
442     // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
443     const int VK_VOLUME_UP = 0xAF;
444 
445     // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
446     const int VK_MEDIA_NEXT_TRACK = 0xB0;
447 
448     // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
449     const int VK_MEDIA_PREV_TRACK = 0xB1;
450 
451     // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
452     const int VK_MEDIA_STOP = 0xB2;
453 
454     // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
455     const int VK_MEDIA_PLAY_PAUSE = 0xB3;
456 
457     // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
458     const int VK_MEDIA_LAUNCH_MAIL = 0xB4;
459 
460     // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
461     const int VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5;
462 
463     // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
464     const int VK_MEDIA_LAUNCH_APP1 = 0xB6;
465 
466     // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
467     const int VK_MEDIA_LAUNCH_APP2 = 0xB7;
468 
469     // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
470     const int VK_OEM_1 = 0xBA;
471 
472     // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
473     const int VK_OEM_PLUS = 0xBB;
474 
475     // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
476     const int VK_OEM_COMMA = 0xBC;
477 
478     // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
479     const int VK_OEM_MINUS = 0xBD;
480 
481     // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
482     const int VK_OEM_PERIOD = 0xBE;
483 
484     // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
485     const int VK_OEM_2 = 0xBF;
486 
487     // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
488     const int VK_OEM_3 = 0xC0;
489 
490     // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
491     const int VK_OEM_4 = 0xDB;
492 
493     // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
494     const int VK_OEM_5 = 0xDC;
495 
496     // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
497     const int VK_OEM_6 = 0xDD;
498 
499     // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
500     const int VK_OEM_7 = 0xDE;
501 
502     // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
503     const int VK_OEM_8 = 0xDF;
504 
505     // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
506     const int VK_OEM_102 = 0xE2;
507 
508     // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
509     const int VK_PROCESSKEY = 0xE5;
510 
511     // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
512     const int VK_PACKET = 0xE7;
513 
514     // VK_ATTN (F6) Attn key
515     const int VK_ATTN = 0xF6;
516 
517     // VK_CRSEL (F7) CrSel key
518     const int VK_CRSEL = 0xF7;
519 
520     // VK_EXSEL (F8) ExSel key
521     const int VK_EXSEL = 0xF8;
522 
523     // VK_EREOF (F9) Erase EOF key
524     const int VK_EREOF = 0xF9;
525 
526     // VK_PLAY (FA) Play key
527     const int VK_PLAY = 0xFA;
528 
529     // VK_ZOOM (FB) Zoom key
530     const int VK_ZOOM = 0xFB;
531 
532     // VK_NONAME (FC) Reserved for future use
533     const int VK_NONAME = 0xFC;
534 
535     // VK_PA1 (FD) PA1 key
536     const int VK_PA1 = 0xFD;
537 
538     // VK_OEM_CLEAR (FE) Clear key
539     const int VK_OEM_CLEAR = 0xFE;
540 
541     const int VK_UNKNOWN = 0;
542 } // namespace WebCore
543 
544 #endif // KeyboardCodes_h
545