1 /* 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 7 * 8 * * Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above 11 * copyright notice, this list of conditions and the following disclaimer 12 * in the documentation and/or other materials provided with the 13 * distribution. 14 * * Neither the name of Google Inc. nor the names of its 15 * contributors may be used to endorse or promote products derived from 16 * this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 #ifndef KeyboardCodes_h 32 #define KeyboardCodes_h 33 34 #if OS(WIN) 35 #include <windows.h> 36 #endif 37 38 #include "platform/WindowsKeyboardCodes.h" 39 40 namespace blink { 41 42 enum { 43 // VKEY_LBUTTON (01) Left mouse button 44 // VKEY_RBUTTON (02) Right mouse button 45 // VKEY_CANCEL (03) Control-break processing 46 // VKEY_MBUTTON (04) Middle mouse button (three-button mouse) 47 // VKEY_XBUTTON1 (05) 48 // VKEY_XBUTTON2 (06) 49 50 // VKEY_BACK (08) BACKSPACE key 51 VKEY_BACK = VK_BACK, 52 53 // VKEY_TAB (09) TAB key 54 VKEY_TAB = VK_TAB, 55 56 // VKEY_CLEAR (0C) CLEAR key 57 VKEY_CLEAR = VK_CLEAR, 58 59 // VKEY_RETURN (0D) 60 VKEY_RETURN = VK_RETURN, 61 62 // VKEY_SHIFT (10) SHIFT key 63 VKEY_SHIFT = VK_SHIFT, 64 65 // VKEY_CONTROL (11) CTRL key 66 VKEY_CONTROL = VK_CONTROL, 67 68 // VKEY_MENU (12) ALT key 69 VKEY_MENU = VK_MENU, 70 71 // VKEY_PAUSE (13) PAUSE key 72 VKEY_PAUSE = VK_PAUSE, 73 74 // VKEY_CAPITAL (14) CAPS LOCK key 75 VKEY_CAPITAL = VK_CAPITAL, 76 77 // VKEY_KANA (15) Input Method Editor (IME) Kana mode 78 VKEY_KANA = VK_KANA, 79 80 // VKEY_HANGUEL (15) IME Hanguel mode (maintained for compatibility, use VKEY_HANGUL) 81 // VKEY_HANGUL (15) IME Hangul mode 82 VKEY_HANGUL = VK_HANGUL, 83 84 // VKEY_JUNJA (17) IME Junja mode 85 VKEY_JUNJA = VK_JUNJA, 86 87 // VKEY_FINAL (18) IME final mode 88 VKEY_FINAL = VK_FINAL, 89 90 // VKEY_HANJA (19) IME Hanja mode 91 VKEY_HANJA = VK_HANJA, 92 93 // VKEY_KANJI (19) IME Kanji mode 94 VKEY_KANJI = VK_KANJI, 95 96 // VKEY_ESCAPE (1B) ESC key 97 VKEY_ESCAPE = VK_ESCAPE, 98 99 // VKEY_CONVERT (1C) IME convert 100 VKEY_CONVERT = VK_CONVERT, 101 102 // VKEY_NONCONVERT (1D) IME nonconvert 103 VKEY_NONCONVERT = VK_NONCONVERT, 104 105 // VKEY_ACCEPT (1E) IME accept 106 VKEY_ACCEPT = VK_ACCEPT, 107 108 // VKEY_MODECHANGE (1F) IME mode change request 109 VKEY_MODECHANGE = VK_MODECHANGE, 110 111 // VKEY_SPACE (20) SPACEBAR 112 VKEY_SPACE = VK_SPACE, 113 114 // VKEY_PRIOR (21) PAGE UP key 115 VKEY_PRIOR = VK_PRIOR, 116 117 // VKEY_NEXT (22) PAGE DOWN key 118 VKEY_NEXT = VK_NEXT, 119 120 // VKEY_END (23) END key 121 VKEY_END = VK_END, 122 123 // VKEY_HOME (24) HOME key 124 VKEY_HOME = VK_HOME, 125 126 // VKEY_LEFT (25) LEFT ARROW key 127 VKEY_LEFT = VK_LEFT, 128 129 // VKEY_UP (26) UP ARROW key 130 VKEY_UP = VK_UP, 131 132 // VKEY_RIGHT (27) RIGHT ARROW key 133 VKEY_RIGHT = VK_RIGHT, 134 135 // VKEY_DOWN (28) DOWN ARROW key 136 VKEY_DOWN = VK_DOWN, 137 138 // VKEY_SELECT (29) SELECT key 139 VKEY_SELECT = VK_SELECT, 140 141 // VKEY_PRINT (2A) PRINT key 142 VKEY_PRINT = VK_PRINT, 143 144 // VKEY_EXECUTE (2B) EXECUTE key 145 VKEY_EXECUTE = VK_EXECUTE, 146 147 // VKEY_SNAPSHOT (2C) PRINT SCREEN key 148 VKEY_SNAPSHOT = VK_SNAPSHOT, 149 150 // VKEY_INSERT (2D) INS key 151 VKEY_INSERT = VK_INSERT, 152 153 // VKEY_DELETE (2E) DEL key 154 VKEY_DELETE = VK_DELETE, 155 156 // VKEY_HELP (2F) HELP key 157 VKEY_HELP = VK_HELP, 158 159 // (30) 0 key 160 VKEY_0 = '0', 161 162 // (31) 1 key 163 VKEY_1 = '1', 164 165 // (32) 2 key 166 VKEY_2 = '2', 167 168 // (33) 3 key 169 VKEY_3 = '3', 170 171 // (34) 4 key 172 VKEY_4 = '4', 173 174 // (35) 5 key, 175 176 VKEY_5 = '5', 177 178 // (36) 6 key 179 VKEY_6 = '6', 180 181 // (37) 7 key 182 VKEY_7 = '7', 183 184 // (38) 8 key 185 VKEY_8 = '8', 186 187 // (39) 9 key 188 VKEY_9 = '9', 189 190 // (41) A key 191 VKEY_A = 'A', 192 193 // (42) B key 194 VKEY_B = 'B', 195 196 // (43) C key 197 VKEY_C = 'C', 198 199 // (44) D key 200 VKEY_D = 'D', 201 202 // (45) E key 203 VKEY_E = 'E', 204 205 // (46) F key 206 VKEY_F = 'F', 207 208 // (47) G key 209 VKEY_G = 'G', 210 211 // (48) H key 212 VKEY_H = 'H', 213 214 // (49) I key 215 VKEY_I = 'I', 216 217 // (4A) J key 218 VKEY_J = 'J', 219 220 // (4B) K key 221 VKEY_K = 'K', 222 223 // (4C) L key 224 VKEY_L = 'L', 225 226 // (4D) M key 227 VKEY_M = 'M', 228 229 // (4E) N key 230 VKEY_N = 'N', 231 232 // (4F) O key 233 VKEY_O = 'O', 234 235 // (50) P key 236 VKEY_P = 'P', 237 238 // (51) Q key 239 VKEY_Q = 'Q', 240 241 // (52) R key 242 VKEY_R = 'R', 243 244 // (53) S key 245 VKEY_S = 'S', 246 247 // (54) T key 248 VKEY_T = 'T', 249 250 // (55) U key 251 VKEY_U = 'U', 252 253 // (56) V key 254 VKEY_V = 'V', 255 256 // (57) W key 257 VKEY_W = 'W', 258 259 // (58) X key 260 VKEY_X = 'X', 261 262 // (59) Y key 263 VKEY_Y = 'Y', 264 265 // (5A) Z key 266 VKEY_Z = 'Z', 267 268 // VKEY_LWIN (5B) Left Windows key (Microsoft Natural keyboard) 269 VKEY_LWIN = VK_LWIN, 270 271 // VKEY_RWIN (5C) Right Windows key (Natural keyboard) 272 VKEY_RWIN = VK_RWIN, 273 274 // VKEY_APPS (5D) Applications key (Natural keyboard) 275 VKEY_APPS = VK_APPS, 276 277 // VKEY_SLEEP (5F) Computer Sleep key 278 VKEY_SLEEP = VK_SLEEP, 279 280 // VKEY_NUMPAD0 (60) Numeric keypad 0 key 281 VKEY_NUMPAD0 = VK_NUMPAD0, 282 283 // VKEY_NUMPAD1 (61) Numeric keypad 1 key 284 VKEY_NUMPAD1 = VK_NUMPAD1, 285 286 // VKEY_NUMPAD2 (62) Numeric keypad 2 key 287 VKEY_NUMPAD2 = VK_NUMPAD2, 288 289 // VKEY_NUMPAD3 (63) Numeric keypad 3 key 290 VKEY_NUMPAD3 = VK_NUMPAD3, 291 292 // VKEY_NUMPAD4 (64) Numeric keypad 4 key 293 VKEY_NUMPAD4 = VK_NUMPAD4, 294 295 // VKEY_NUMPAD5 (65) Numeric keypad 5 key 296 VKEY_NUMPAD5 = VK_NUMPAD5, 297 298 // VKEY_NUMPAD6 (66) Numeric keypad 6 key 299 VKEY_NUMPAD6 = VK_NUMPAD6, 300 301 // VKEY_NUMPAD7 (67) Numeric keypad 7 key 302 VKEY_NUMPAD7 = VK_NUMPAD7, 303 304 // VKEY_NUMPAD8 (68) Numeric keypad 8 key 305 VKEY_NUMPAD8 = VK_NUMPAD8, 306 307 // VKEY_NUMPAD9 (69) Numeric keypad 9 key 308 VKEY_NUMPAD9 = VK_NUMPAD9, 309 310 // VKEY_MULTIPLY (6A) Multiply key 311 VKEY_MULTIPLY = VK_MULTIPLY, 312 313 // VKEY_ADD (6B) Add key 314 VKEY_ADD = VK_ADD, 315 316 // VKEY_SEPARATOR (6C) Separator key 317 VKEY_SEPARATOR = VK_SEPARATOR, 318 319 // VKEY_SUBTRACT (6D) Subtract key 320 VKEY_SUBTRACT = VK_SUBTRACT, 321 322 // VKEY_DECIMAL (6E) Decimal key 323 VKEY_DECIMAL = VK_DECIMAL, 324 325 // VKEY_DIVIDE (6F) Divide key 326 VKEY_DIVIDE = VK_DIVIDE, 327 328 // VKEY_F1 (70) F1 key 329 VKEY_F1 = VK_F1, 330 331 // VKEY_F2 (71) F2 key 332 VKEY_F2 = VK_F2, 333 334 // VKEY_F3 (72) F3 key 335 VKEY_F3 = VK_F3, 336 337 // VKEY_F4 (73) F4 key 338 VKEY_F4 = VK_F4, 339 340 // VKEY_F5 (74) F5 key 341 VKEY_F5 = VK_F5, 342 343 // VKEY_F6 (75) F6 key 344 VKEY_F6 = VK_F6, 345 346 // VKEY_F7 (76) F7 key 347 VKEY_F7 = VK_F7, 348 349 // VKEY_F8 (77) F8 key 350 VKEY_F8 = VK_F8, 351 352 // VKEY_F9 (78) F9 key 353 VKEY_F9 = VK_F9, 354 355 // VKEY_F10 (79) F10 key 356 VKEY_F10 = VK_F10, 357 358 // VKEY_F11 (7A) F11 key 359 VKEY_F11 = VK_F11, 360 361 // VKEY_F12 (7B) F12 key 362 VKEY_F12 = VK_F12, 363 364 // VKEY_F13 (7C) F13 key 365 VKEY_F13 = VK_F13, 366 367 // VKEY_F14 (7D) F14 key 368 VKEY_F14 = VK_F14, 369 370 // VKEY_F15 (7E) F15 key 371 VKEY_F15 = VK_F15, 372 373 // VKEY_F16 (7F) F16 key 374 VKEY_F16 = VK_F16, 375 376 // VKEY_F17 (80H) F17 key 377 VKEY_F17 = VK_F17, 378 379 // VKEY_F18 (81H) F18 key 380 VKEY_F18 = VK_F18, 381 382 // VKEY_F19 (82H) F19 key 383 VKEY_F19 = VK_F19, 384 385 // VKEY_F20 (83H) F20 key 386 VKEY_F20 = VK_F20, 387 388 // VKEY_F21 (84H) F21 key 389 VKEY_F21 = VK_F21, 390 391 // VKEY_F22 (85H) F22 key 392 VKEY_F22 = VK_F22, 393 394 // VKEY_F23 (86H) F23 key 395 VKEY_F23 = VK_F23, 396 397 // VKEY_F24 (87H) F24 key 398 VKEY_F24 = VK_F24, 399 400 // VKEY_NUMLOCK (90) NUM LOCK key 401 VKEY_NUMLOCK = VK_NUMLOCK, 402 403 // VKEY_SCROLL (91) SCROLL LOCK key 404 VKEY_SCROLL = VK_SCROLL, 405 406 // VKEY_LSHIFT (A0) Left SHIFT key 407 VKEY_LSHIFT = VK_LSHIFT, 408 409 // VKEY_RSHIFT (A1) Right SHIFT key 410 VKEY_RSHIFT = VK_RSHIFT, 411 412 // VKEY_LCONTROL (A2) Left CONTROL key 413 VKEY_LCONTROL = VK_LCONTROL, 414 415 // VKEY_RCONTROL (A3) Right CONTROL key 416 VKEY_RCONTROL = VK_RCONTROL, 417 418 // VKEY_LMENU (A4) Left MENU key 419 VKEY_LMENU = VK_LMENU, 420 421 // VKEY_RMENU (A5) Right MENU key 422 VKEY_RMENU = VK_RMENU, 423 424 // VKEY_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key 425 VKEY_BROWSER_BACK = VK_BROWSER_BACK, 426 427 // VKEY_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key 428 VKEY_BROWSER_FORWARD = VK_BROWSER_FORWARD, 429 430 // VKEY_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key 431 VKEY_BROWSER_REFRESH = VK_BROWSER_REFRESH, 432 433 // VKEY_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key 434 VKEY_BROWSER_STOP = VK_BROWSER_STOP, 435 436 // VKEY_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key 437 VKEY_BROWSER_SEARCH = VK_BROWSER_SEARCH, 438 439 // VKEY_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key 440 VKEY_BROWSER_FAVORITES = VK_BROWSER_FAVORITES, 441 442 // VKEY_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key 443 VKEY_BROWSER_HOME = VK_BROWSER_HOME, 444 445 // VKEY_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key 446 VKEY_VOLUME_MUTE = VK_VOLUME_MUTE, 447 448 // VKEY_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key 449 VKEY_VOLUME_DOWN = VK_VOLUME_DOWN, 450 451 // VKEY_VOLUME_UP (AF) Windows 2000/XP: Volume Up key 452 VKEY_VOLUME_UP = VK_VOLUME_UP, 453 454 // VKEY_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key 455 VKEY_MEDIA_NEXT_TRACK = VK_MEDIA_NEXT_TRACK, 456 457 // VKEY_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key 458 VKEY_MEDIA_PREV_TRACK = VK_MEDIA_PREV_TRACK, 459 460 // VKEY_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key 461 VKEY_MEDIA_STOP = VK_MEDIA_STOP, 462 463 // VKEY_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key 464 VKEY_MEDIA_PLAY_PAUSE = VK_MEDIA_PLAY_PAUSE, 465 466 // VKEY_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key 467 VKEY_MEDIA_LAUNCH_MAIL = 0xB4, 468 469 // VKEY_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key 470 VKEY_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5, 471 472 // VKEY_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key 473 VKEY_MEDIA_LAUNCH_APP1 = 0xB6, 474 475 // VKEY_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key 476 VKEY_MEDIA_LAUNCH_APP2 = 0xB7, 477 478 // VKEY_OEM_1 (BA) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ',:' key 479 VKEY_OEM_1 = VK_OEM_1, 480 481 // VKEY_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key 482 VKEY_OEM_PLUS = VK_OEM_PLUS, 483 484 // VKEY_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key 485 VKEY_OEM_COMMA = VK_OEM_COMMA, 486 487 // VKEY_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key 488 VKEY_OEM_MINUS = VK_OEM_MINUS, 489 490 // VKEY_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key 491 VKEY_OEM_PERIOD = VK_OEM_PERIOD, 492 493 // VKEY_OEM_2 (BF) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key 494 VKEY_OEM_2 = VK_OEM_2, 495 496 // VKEY_OEM_3 (C0) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key 497 VKEY_OEM_3 = VK_OEM_3, 498 499 // VKEY_OEM_4 (DB) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key 500 VKEY_OEM_4 = VK_OEM_4, 501 502 // VKEY_OEM_5 (DC) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key 503 VKEY_OEM_5 = VK_OEM_5, 504 505 // VKEY_OEM_6 (DD) Used for miscellaneous characters, it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key 506 VKEY_OEM_6 = VK_OEM_6, 507 508 // VKEY_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 509 VKEY_OEM_7 = VK_OEM_7, 510 511 // VKEY_OEM_8 (DF) Used for miscellaneous characters, it can vary by keyboard. 512 VKEY_OEM_8 = VK_OEM_8, 513 514 // VKEY_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard 515 VKEY_OEM_102 = VK_OEM_102, 516 517 // VKEY_OEM_103 (E3) GTV KEYCODE_MEDIA_REWIND 518 VKEY_OEM_103 = 0xE3, 519 520 // VKEY_OEM_104 (E4) GTV KEYCODE_MEDIA_FAST_FORWARD 521 VKEY_OEM_104 = 0xE4, 522 523 // VKEY_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key 524 VKEY_PROCESSKEY = VK_PROCESSKEY, 525 526 // VKEY_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VKEY_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 527 VKEY_PACKET = VK_PACKET, 528 529 // VKEY_ATTN (F6) Attn key 530 VKEY_ATTN = VK_ATTN, 531 532 // VKEY_CRSEL (F7) CrSel key 533 VKEY_CRSEL = VK_CRSEL, 534 535 // VKEY_EXSEL (F8) ExSel key 536 VKEY_EXSEL = VK_EXSEL, 537 538 // VKEY_EREOF (F9) Erase EOF key 539 VKEY_EREOF = VK_EREOF, 540 541 // VKEY_PLAY (FA) Play key 542 VKEY_PLAY = VK_PLAY, 543 544 // VKEY_ZOOM (FB) Zoom key 545 VKEY_ZOOM = VK_ZOOM, 546 547 // VKEY_NONAME (FC) Reserved for future use 548 VKEY_NONAME = VK_NONAME, 549 550 // VKEY_PA1 (FD) PA1 key 551 VKEY_PA1 = VK_PA1, 552 553 // VKEY_OEM_CLEAR (FE) Clear key 554 VKEY_OEM_CLEAR = VK_OEM_CLEAR, 555 556 VKEY_UNKNOWN = 0 557 }; 558 559 } // namespace blink 560 561 #endif 562