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 namespace ui { | 8 namespace ui { |
9 | 9 |
10 // This table maps a DomCode to a printable character, assuming US layout. | 10 // This table maps a DomCode to a printable character, assuming US layout. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 {DomCode::EQUAL, {'=', '+'}}, | 53 {DomCode::EQUAL, {'=', '+'}}, |
54 {DomCode::BRACKET_LEFT, {'[', '{'}}, | 54 {DomCode::BRACKET_LEFT, {'[', '{'}}, |
55 {DomCode::BRACKET_RIGHT, {']', '}'}}, | 55 {DomCode::BRACKET_RIGHT, {']', '}'}}, |
56 {DomCode::BACKSLASH, {'\\', '|'}}, | 56 {DomCode::BACKSLASH, {'\\', '|'}}, |
57 {DomCode::SEMICOLON, {';', ':'}}, | 57 {DomCode::SEMICOLON, {';', ':'}}, |
58 {DomCode::QUOTE, {'\'', '"'}}, | 58 {DomCode::QUOTE, {'\'', '"'}}, |
59 {DomCode::BACKQUOTE, {'`', '~'}}, | 59 {DomCode::BACKQUOTE, {'`', '~'}}, |
60 {DomCode::COMMA, {',', '<'}}, | 60 {DomCode::COMMA, {',', '<'}}, |
61 {DomCode::PERIOD, {'.', '>'}}, | 61 {DomCode::PERIOD, {'.', '>'}}, |
62 {DomCode::SLASH, {'/', '?'}}, | 62 {DomCode::SLASH, {'/', '?'}}, |
63 {DomCode::INTL_BACKSLASH, {'\\', '|'}}, | 63 {DomCode::INTL_BACKSLASH, {'<', '>'}}, |
Wez
2015/04/28 00:28:04
Why do we need this and INTL_YEN, below, if this i
kpschoedel
2015/04/28 17:03:45
The keys are normally supported in US layouts, whe
Wez
2015/05/05 00:16:00
Mapping from VKEY to |code| is a legacy-compatibil
kpschoedel
2015/05/05 18:47:02
Acknowledged — will keep GetCharacterFromKeyCode()
| |
64 {DomCode::INTL_YEN, {0x00A5, '|'}}, | 64 {DomCode::INTL_YEN, {0x00A5, '|'}}, |
65 {DomCode::NUMPAD_DIVIDE, {'/', '/'}}, | 65 {DomCode::NUMPAD_DIVIDE, {'/', '/'}}, |
66 {DomCode::NUMPAD_MULTIPLY, {'*', '*'}}, | 66 {DomCode::NUMPAD_MULTIPLY, {'*', '*'}}, |
67 {DomCode::NUMPAD_SUBTRACT, {'-', '-'}}, | 67 {DomCode::NUMPAD_SUBTRACT, {'-', '-'}}, |
68 {DomCode::NUMPAD_ADD, {'+', '+'}}, | 68 {DomCode::NUMPAD_ADD, {'+', '+'}}, |
69 {DomCode::NUMPAD1, {'1', '1'}}, | 69 {DomCode::NUMPAD1, {'1', '1'}}, |
70 {DomCode::NUMPAD2, {'2', '2'}}, | 70 {DomCode::NUMPAD2, {'2', '2'}}, |
71 {DomCode::NUMPAD3, {'3', '3'}}, | 71 {DomCode::NUMPAD3, {'3', '3'}}, |
72 {DomCode::NUMPAD4, {'4', '4'}}, | 72 {DomCode::NUMPAD4, {'4', '4'}}, |
73 {DomCode::NUMPAD5, {'5', '5'}}, | 73 {DomCode::NUMPAD5, {'5', '5'}}, |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
573 VKEY_BROWSER_FAVORITES}, // 0x0C022A BrowserFavorites | 573 VKEY_BROWSER_FAVORITES}, // 0x0C022A BrowserFavorites |
574 {DomCode::ZOOM_TOGGLE, VKEY_ZOOM}, // 0x0C0232 ZoomToggle | 574 {DomCode::ZOOM_TOGGLE, VKEY_ZOOM}, // 0x0C0232 ZoomToggle |
575 }; | 575 }; |
576 | 576 |
577 // This table, used by UsLayoutKeyboardCodeToDomCode(), maps legacy | 577 // This table, used by UsLayoutKeyboardCodeToDomCode(), maps legacy |
578 // Windows-based VKEY values that are not part of kDomCodeToKeyboardCodeMap[] | 578 // Windows-based VKEY values that are not part of kDomCodeToKeyboardCodeMap[] |
579 // to suitable DomCode values, where practical. | 579 // to suitable DomCode values, where practical. |
580 const DomCodeToKeyboardCodeEntry kFallbackKeyboardCodeToDomCodeMap[] = { | 580 const DomCodeToKeyboardCodeEntry kFallbackKeyboardCodeToDomCodeMap[] = { |
581 {DomCode::ALT_LEFT, VKEY_MENU}, | 581 {DomCode::ALT_LEFT, VKEY_MENU}, |
582 {DomCode::ALT_RIGHT, VKEY_ALTGR}, | 582 {DomCode::ALT_RIGHT, VKEY_ALTGR}, |
583 {DomCode::BACKQUOTE, VKEY_DBE_SBCSCHAR}, | |
584 #if defined(OS_POSIX) | 583 #if defined(OS_POSIX) |
585 {DomCode::CONTEXT_MENU, VKEY_COMPOSE}, | 584 {DomCode::CONTEXT_MENU, VKEY_COMPOSE}, |
586 #endif | 585 #endif |
587 {DomCode::CONTROL_LEFT, VKEY_CONTROL}, | 586 {DomCode::CONTROL_LEFT, VKEY_CONTROL}, |
588 {DomCode::LANG1, VKEY_HANGUL}, | 587 {DomCode::LANG1, VKEY_HANGUL}, |
589 {DomCode::LANG2, VKEY_HANJA}, | 588 {DomCode::LANG2, VKEY_HANJA}, |
590 {DomCode::LANG5, VKEY_DBE_DBCSCHAR}, | 589 {DomCode::LANG5, VKEY_DBE_DBCSCHAR}, |
591 {DomCode::NUMPAD_CLEAR, VKEY_OEM_CLEAR}, | 590 {DomCode::NUMPAD_CLEAR, VKEY_OEM_CLEAR}, |
591 {DomCode::NUMPAD_DECIMAL, VKEY_SEPARATOR}, | |
592 {DomCode::PROPS, VKEY_CRSEL}, | 592 {DomCode::PROPS, VKEY_CRSEL}, |
593 {DomCode::SHIFT_LEFT, VKEY_SHIFT}, | 593 {DomCode::SHIFT_LEFT, VKEY_SHIFT}, |
594 {DomCode::SUPER, VKEY_OEM_8}, | 594 {DomCode::SUPER, VKEY_OEM_8}, |
595 // | 595 // |
596 // VKEYs with no existing corresponding DomCode, but a USB usage code: | 596 // VKEYs with no directly corresponding DomCode, but a USB usage code: |
Wez
2015/04/28 00:28:04
Why do we have a DomCode::<name> in the comment fo
kpschoedel
2015/04/28 17:03:45
Left over from the (scripted) table entries. Remov
| |
597 // {DomCode::SYS_REQ, VKEY_ATTN}, // 0x07009A SysReq | 597 // {DomCode::SYS_REQ, VKEY_ATTN}, // 0x07009A SysReq |
598 // {DomCode::SEPARATOR, VKEY_SEPARATOR}, // 0x07009F Separator | 598 // {DomCode::SEPARATOR, VKEY_SEPARATOR}, // 0x07009F Separator |
Wez
2015/04/28 00:28:04
Remove this?
kpschoedel
2015/04/28 17:03:45
Done.
| |
599 // {DomCode::EX_SEL, VKEY_EXSEL}, // 0x0700A4 ExSel | 599 // {DomCode::EX_SEL, VKEY_EXSEL}, // 0x0700A4 ExSel |
600 // {DomCode::PRINT, VKEY_PRINT}, // 0x0C0208 AC Print | 600 // {DomCode::PRINT, VKEY_PRINT}, // 0x0C0208 AC Print |
601 // {DomCode::MEDIA_PLAY, VKEY_PLAY}, // 0x0C00B0 MediaPlay | 601 // {DomCode::MEDIA_PLAY, VKEY_PLAY}, // 0x0C00B0 MediaPlay |
602 // {DomCode::MEDIA_REWIND, VKEY_OEM_103}, // 0x0C00B4 MediaRewind | 602 // {DomCode::MEDIA_REWIND, VKEY_OEM_103}, // 0x0C00B4 MediaRewind |
603 // {DomCode::MEDIA_FAST_FORWARD, VKEY_OEM_104}, | 603 // {DomCode::MEDIA_FAST_FORWARD, VKEY_OEM_104}, |
604 // // 0x0C00B3 MediaFastForward | 604 // // 0x0C00B3 MediaFastForward |
605 // | 605 // |
606 // VKEYs with no corresponding DomCode, but a Linux evdev usage code: | |
607 // VKEY_KBD_BRIGHTNESS_DOWN // evdev KEY_KBDILLUMDOWN | |
608 // VKEY_KBD_BRIGHTNESS_UP // evdev KEY_KBDILLUMUP | |
609 // VKEY_WLAN // evdev KEY_WLAN | |
610 // | |
606 // VKEYs with no corresponding DomCode and no obvious USB usage code: | 611 // VKEYs with no corresponding DomCode and no obvious USB usage code: |
607 // VKEY_ACCEPT | 612 // VKEY_ACCEPT |
608 // VKEY_BACKTAB | 613 // VKEY_BACKTAB |
614 // VKEY_DBE_SBCSCHAR | |
609 // VKEY_EREOF | 615 // VKEY_EREOF |
610 // VKEY_FINAL | 616 // VKEY_FINAL |
611 // VKEY_JUNJA | 617 // VKEY_JUNJA |
612 // VKEY_KBD_BRIGHTNESS_DOWN | |
613 // VKEY_KBD_BRIGHTNESS_UP | |
614 // VKEY_MODECHANGE | 618 // VKEY_MODECHANGE |
615 // VKEY_NONAME | 619 // VKEY_NONAME |
616 // VKEY_PA1 | 620 // VKEY_PA1 |
617 // VKEY_PACKET | 621 // VKEY_PACKET |
618 // VKEY_PROCESSKEY | 622 // VKEY_PROCESSKEY |
619 // VKEY_WLAN | |
620 }; | 623 }; |
621 | 624 |
622 } // namespace ui | 625 } // namespace ui |
623 | 626 |
624 #endif // UI_EVENTS_KEYCODES_DOM_US_LAYOUT_DATA_H_ | 627 #endif // UI_EVENTS_KEYCODES_DOM_US_LAYOUT_DATA_H_ |
OLD | NEW |