OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_EVENTS_KEYCODES_DOM_US_LAYOUT_DATA_H_ | 5 #ifndef UI_EVENTS_KEYCODES_DOM_US_LAYOUT_DATA_H_ |
6 #define UI_EVENTS_KEYCODES_DOM_US_LAYOUT_DATA_H_ | 6 #define UI_EVENTS_KEYCODES_DOM_US_LAYOUT_DATA_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
11 | 11 |
12 // This table maps a DomCode to a printable character, assuming US layout. | 12 // This table maps a DomCode to a printable character, assuming US layout. |
13 // It is used by DomCodeToUsLayoutDomKey(), which provides a fallback | 13 // It is used by DomCodeToUsLayoutDomKey(), which provides a fallback |
14 // interpretation when there is no other way to map a physical key. | 14 // interpretation when there is no other way to map a physical key. |
15 const struct PrintableCodeEntry { | 15 const struct PrintableCodeEntry { |
16 DomCode dom_code; | 16 DomCode dom_code; |
17 base::char16 character[2]; // normal, shift | 17 base::char16 character[2]; // normal, shift |
18 } kPrintableCodeMap[] = { | 18 } kPrintableCodeMap[] = { |
19 {DomCode::KEY_A, {'a', 'A'}}, | 19 {DomCode::US_A, {'a', 'A'}}, |
20 {DomCode::KEY_B, {'b', 'B'}}, | 20 {DomCode::US_B, {'b', 'B'}}, |
21 {DomCode::KEY_C, {'c', 'C'}}, | 21 {DomCode::US_C, {'c', 'C'}}, |
22 {DomCode::KEY_D, {'d', 'D'}}, | 22 {DomCode::US_D, {'d', 'D'}}, |
23 {DomCode::KEY_E, {'e', 'E'}}, | 23 {DomCode::US_E, {'e', 'E'}}, |
24 {DomCode::KEY_F, {'f', 'F'}}, | 24 {DomCode::US_F, {'f', 'F'}}, |
25 {DomCode::KEY_G, {'g', 'G'}}, | 25 {DomCode::US_G, {'g', 'G'}}, |
26 {DomCode::KEY_H, {'h', 'H'}}, | 26 {DomCode::US_H, {'h', 'H'}}, |
27 {DomCode::KEY_I, {'i', 'I'}}, | 27 {DomCode::US_I, {'i', 'I'}}, |
28 {DomCode::KEY_J, {'j', 'J'}}, | 28 {DomCode::US_J, {'j', 'J'}}, |
29 {DomCode::KEY_K, {'k', 'K'}}, | 29 {DomCode::US_K, {'k', 'K'}}, |
30 {DomCode::KEY_L, {'l', 'L'}}, | 30 {DomCode::US_L, {'l', 'L'}}, |
31 {DomCode::KEY_M, {'m', 'M'}}, | 31 {DomCode::US_M, {'m', 'M'}}, |
32 {DomCode::KEY_N, {'n', 'N'}}, | 32 {DomCode::US_N, {'n', 'N'}}, |
33 {DomCode::KEY_O, {'o', 'O'}}, | 33 {DomCode::US_O, {'o', 'O'}}, |
34 {DomCode::KEY_P, {'p', 'P'}}, | 34 {DomCode::US_P, {'p', 'P'}}, |
35 {DomCode::KEY_Q, {'q', 'Q'}}, | 35 {DomCode::US_Q, {'q', 'Q'}}, |
36 {DomCode::KEY_R, {'r', 'R'}}, | 36 {DomCode::US_R, {'r', 'R'}}, |
37 {DomCode::KEY_S, {'s', 'S'}}, | 37 {DomCode::US_S, {'s', 'S'}}, |
38 {DomCode::KEY_T, {'t', 'T'}}, | 38 {DomCode::US_T, {'t', 'T'}}, |
39 {DomCode::KEY_U, {'u', 'U'}}, | 39 {DomCode::US_U, {'u', 'U'}}, |
40 {DomCode::KEY_V, {'v', 'V'}}, | 40 {DomCode::US_V, {'v', 'V'}}, |
41 {DomCode::KEY_W, {'w', 'W'}}, | 41 {DomCode::US_W, {'w', 'W'}}, |
42 {DomCode::KEY_X, {'x', 'X'}}, | 42 {DomCode::US_X, {'x', 'X'}}, |
43 {DomCode::KEY_Y, {'y', 'Y'}}, | 43 {DomCode::US_Y, {'y', 'Y'}}, |
44 {DomCode::KEY_Z, {'z', 'Z'}}, | 44 {DomCode::US_Z, {'z', 'Z'}}, |
45 {DomCode::DIGIT1, {'1', '!'}}, | 45 {DomCode::DIGIT1, {'1', '!'}}, |
46 {DomCode::DIGIT2, {'2', '@'}}, | 46 {DomCode::DIGIT2, {'2', '@'}}, |
47 {DomCode::DIGIT3, {'3', '#'}}, | 47 {DomCode::DIGIT3, {'3', '#'}}, |
48 {DomCode::DIGIT4, {'4', '$'}}, | 48 {DomCode::DIGIT4, {'4', '$'}}, |
49 {DomCode::DIGIT5, {'5', '%'}}, | 49 {DomCode::DIGIT5, {'5', '%'}}, |
50 {DomCode::DIGIT6, {'6', '^'}}, | 50 {DomCode::DIGIT6, {'6', '^'}}, |
51 {DomCode::DIGIT7, {'7', '&'}}, | 51 {DomCode::DIGIT7, {'7', '&'}}, |
52 {DomCode::DIGIT8, {'8', '*'}}, | 52 {DomCode::DIGIT8, {'8', '*'}}, |
53 {DomCode::DIGIT9, {'9', '('}}, | 53 {DomCode::DIGIT9, {'9', '('}}, |
54 {DomCode::DIGIT0, {'0', ')'}}, | 54 {DomCode::DIGIT0, {'0', ')'}}, |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // which is the USB physical key code. | 380 // which is the USB physical key code. |
381 // DomCode::HYPER 0x000010 Hyper | 381 // DomCode::HYPER 0x000010 Hyper |
382 // DomCode::SUPER 0x000011 Super | 382 // DomCode::SUPER 0x000011 Super |
383 // DomCode::FN 0x000012 Fn | 383 // DomCode::FN 0x000012 Fn |
384 // DomCode::FN_LOCK 0x000013 FLock | 384 // DomCode::FN_LOCK 0x000013 FLock |
385 // DomCode::SUSPEND 0x000014 Suspend | 385 // DomCode::SUSPEND 0x000014 Suspend |
386 // DomCode::RESUME 0x000015 Resume | 386 // DomCode::RESUME 0x000015 Resume |
387 // DomCode::TURBO 0x000016 Turbo | 387 // DomCode::TURBO 0x000016 Turbo |
388 {DomCode::SLEEP, VKEY_SLEEP}, // 0x010082 Sleep | 388 {DomCode::SLEEP, VKEY_SLEEP}, // 0x010082 Sleep |
389 // DomCode::WAKE_UP 0x010083 WakeUp | 389 // DomCode::WAKE_UP 0x010083 WakeUp |
390 {DomCode::KEY_A, VKEY_A}, // 0x070004 KeyA | 390 {DomCode::US_A, VKEY_A}, // 0x070004 KeyA |
391 {DomCode::KEY_B, VKEY_B}, // 0x070005 KeyB | 391 {DomCode::US_B, VKEY_B}, // 0x070005 KeyB |
392 {DomCode::KEY_C, VKEY_C}, // 0x070006 KeyC | 392 {DomCode::US_C, VKEY_C}, // 0x070006 KeyC |
393 {DomCode::KEY_D, VKEY_D}, // 0x070007 KeyD | 393 {DomCode::US_D, VKEY_D}, // 0x070007 KeyD |
394 {DomCode::KEY_E, VKEY_E}, // 0x070008 KeyE | 394 {DomCode::US_E, VKEY_E}, // 0x070008 KeyE |
395 {DomCode::KEY_F, VKEY_F}, // 0x070009 KeyF | 395 {DomCode::US_F, VKEY_F}, // 0x070009 KeyF |
396 {DomCode::KEY_G, VKEY_G}, // 0x07000A KeyG | 396 {DomCode::US_G, VKEY_G}, // 0x07000A KeyG |
397 {DomCode::KEY_H, VKEY_H}, // 0x07000B KeyH | 397 {DomCode::US_H, VKEY_H}, // 0x07000B KeyH |
398 {DomCode::KEY_I, VKEY_I}, // 0x07000C KeyI | 398 {DomCode::US_I, VKEY_I}, // 0x07000C KeyI |
399 {DomCode::KEY_J, VKEY_J}, // 0x07000D KeyJ | 399 {DomCode::US_J, VKEY_J}, // 0x07000D KeyJ |
400 {DomCode::KEY_K, VKEY_K}, // 0x07000E KeyK | 400 {DomCode::US_K, VKEY_K}, // 0x07000E KeyK |
401 {DomCode::KEY_L, VKEY_L}, // 0x07000F KeyL | 401 {DomCode::US_L, VKEY_L}, // 0x07000F KeyL |
402 {DomCode::KEY_M, VKEY_M}, // 0x070010 KeyM | 402 {DomCode::US_M, VKEY_M}, // 0x070010 KeyM |
403 {DomCode::KEY_N, VKEY_N}, // 0x070011 KeyN | 403 {DomCode::US_N, VKEY_N}, // 0x070011 KeyN |
404 {DomCode::KEY_O, VKEY_O}, // 0x070012 KeyO | 404 {DomCode::US_O, VKEY_O}, // 0x070012 KeyO |
405 {DomCode::KEY_P, VKEY_P}, // 0x070013 KeyP | 405 {DomCode::US_P, VKEY_P}, // 0x070013 KeyP |
406 {DomCode::KEY_Q, VKEY_Q}, // 0x070014 KeyQ | 406 {DomCode::US_Q, VKEY_Q}, // 0x070014 KeyQ |
407 {DomCode::KEY_R, VKEY_R}, // 0x070015 KeyR | 407 {DomCode::US_R, VKEY_R}, // 0x070015 KeyR |
408 {DomCode::KEY_S, VKEY_S}, // 0x070016 KeyS | 408 {DomCode::US_S, VKEY_S}, // 0x070016 KeyS |
409 {DomCode::KEY_T, VKEY_T}, // 0x070017 KeyT | 409 {DomCode::US_T, VKEY_T}, // 0x070017 KeyT |
410 {DomCode::KEY_U, VKEY_U}, // 0x070018 KeyU | 410 {DomCode::US_U, VKEY_U}, // 0x070018 KeyU |
411 {DomCode::KEY_V, VKEY_V}, // 0x070019 KeyV | 411 {DomCode::US_V, VKEY_V}, // 0x070019 KeyV |
412 {DomCode::KEY_W, VKEY_W}, // 0x07001A KeyW | 412 {DomCode::US_W, VKEY_W}, // 0x07001A KeyW |
413 {DomCode::KEY_X, VKEY_X}, // 0x07001B KeyX | 413 {DomCode::US_X, VKEY_X}, // 0x07001B KeyX |
414 {DomCode::KEY_Y, VKEY_Y}, // 0x07001C KeyY | 414 {DomCode::US_Y, VKEY_Y}, // 0x07001C KeyY |
415 {DomCode::KEY_Z, VKEY_Z}, // 0x07001D KeyZ | 415 {DomCode::US_Z, VKEY_Z}, // 0x07001D KeyZ |
416 {DomCode::DIGIT1, VKEY_1}, // 0x07001E Digit1 | 416 {DomCode::DIGIT1, VKEY_1}, // 0x07001E Digit1 |
417 {DomCode::DIGIT2, VKEY_2}, // 0x07001F Digit2 | 417 {DomCode::DIGIT2, VKEY_2}, // 0x07001F Digit2 |
418 {DomCode::DIGIT3, VKEY_3}, // 0x070020 Digit3 | 418 {DomCode::DIGIT3, VKEY_3}, // 0x070020 Digit3 |
419 {DomCode::DIGIT4, VKEY_4}, // 0x070021 Digit4 | 419 {DomCode::DIGIT4, VKEY_4}, // 0x070021 Digit4 |
420 {DomCode::DIGIT5, VKEY_5}, // 0x070022 Digit5 | 420 {DomCode::DIGIT5, VKEY_5}, // 0x070022 Digit5 |
421 {DomCode::DIGIT6, VKEY_6}, // 0x070023 Digit6 | 421 {DomCode::DIGIT6, VKEY_6}, // 0x070023 Digit6 |
422 {DomCode::DIGIT7, VKEY_7}, // 0x070024 Digit7 | 422 {DomCode::DIGIT7, VKEY_7}, // 0x070024 Digit7 |
423 {DomCode::DIGIT8, VKEY_8}, // 0x070025 Digit8 | 423 {DomCode::DIGIT8, VKEY_8}, // 0x070025 Digit8 |
424 {DomCode::DIGIT9, VKEY_9}, // 0x070026 Digit9 | 424 {DomCode::DIGIT9, VKEY_9}, // 0x070026 Digit9 |
425 {DomCode::DIGIT0, VKEY_0}, // 0x070027 Digit0 | 425 {DomCode::DIGIT0, VKEY_0}, // 0x070027 Digit0 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 // VKEY_MODECHANGE | 623 // VKEY_MODECHANGE |
624 // VKEY_NONAME | 624 // VKEY_NONAME |
625 // VKEY_PA1 | 625 // VKEY_PA1 |
626 // VKEY_PACKET | 626 // VKEY_PACKET |
627 // VKEY_PROCESSKEY | 627 // VKEY_PROCESSKEY |
628 }; | 628 }; |
629 | 629 |
630 } // namespace ui | 630 } // namespace ui |
631 | 631 |
632 #endif // UI_EVENTS_KEYCODES_DOM_US_LAYOUT_DATA_H_ | 632 #endif // UI_EVENTS_KEYCODES_DOM_US_LAYOUT_DATA_H_ |
OLD | NEW |