OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/events/keycodes/keyboard_code_conversion_x.h" | 5 #include "ui/events/keycodes/keyboard_code_conversion_x.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #define XK_3270 // for XK_3270_BackTab | 9 #define XK_3270 // for XK_3270_BackTab |
10 #include <X11/XF86keysym.h> | 10 #include <X11/XF86keysym.h> |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 case XK_ugrave: | 773 case XK_ugrave: |
774 case XK_Ugrave: | 774 case XK_Ugrave: |
775 case XK_brokenbar: | 775 case XK_brokenbar: |
776 return VKEY_OEM_102; // international backslash key in 102 keyboard. | 776 return VKEY_OEM_102; // international backslash key in 102 keyboard. |
777 | 777 |
778 // When evdev is in use, /usr/share/X11/xkb/symbols/inet maps F13-18 keys | 778 // When evdev is in use, /usr/share/X11/xkb/symbols/inet maps F13-18 keys |
779 // to the special XF86XK symbols to support Microsoft Ergonomic keyboards: | 779 // to the special XF86XK symbols to support Microsoft Ergonomic keyboards: |
780 // https://bugs.freedesktop.org/show_bug.cgi?id=5783 | 780 // https://bugs.freedesktop.org/show_bug.cgi?id=5783 |
781 // In Chrome, we map these X key symbols back to F13-18 since we don't have | 781 // In Chrome, we map these X key symbols back to F13-18 since we don't have |
782 // VKEYs for these XF86XK symbols. | 782 // VKEYs for these XF86XK symbols. |
| 783 case XF86XK_Tools: |
| 784 return VKEY_F13; |
783 case XF86XK_Launch5: | 785 case XF86XK_Launch5: |
784 return VKEY_F14; | 786 return VKEY_F14; |
785 case XF86XK_Launch6: | 787 case XF86XK_Launch6: |
786 return VKEY_F15; | 788 return VKEY_F15; |
787 case XF86XK_Launch7: | 789 case XF86XK_Launch7: |
788 return VKEY_F16; | 790 return VKEY_F16; |
789 case XF86XK_Launch8: | 791 case XF86XK_Launch8: |
790 return VKEY_F17; | 792 return VKEY_F17; |
791 case XF86XK_Launch9: | 793 case XF86XK_Launch9: |
792 return VKEY_F18; | 794 return VKEY_F18; |
(...skipping 27 matching lines...) Expand all Loading... |
820 return VKEY_MEDIA_STOP; | 822 return VKEY_MEDIA_STOP; |
821 case XF86XK_AudioPlay: | 823 case XF86XK_AudioPlay: |
822 return VKEY_MEDIA_PLAY_PAUSE; | 824 return VKEY_MEDIA_PLAY_PAUSE; |
823 case XF86XK_Mail: | 825 case XF86XK_Mail: |
824 return VKEY_MEDIA_LAUNCH_MAIL; | 826 return VKEY_MEDIA_LAUNCH_MAIL; |
825 case XF86XK_LaunchA: // F3 on an Apple keyboard. | 827 case XF86XK_LaunchA: // F3 on an Apple keyboard. |
826 return VKEY_MEDIA_LAUNCH_APP1; | 828 return VKEY_MEDIA_LAUNCH_APP1; |
827 case XF86XK_LaunchB: // F4 on an Apple keyboard. | 829 case XF86XK_LaunchB: // F4 on an Apple keyboard. |
828 case XF86XK_Calculator: | 830 case XF86XK_Calculator: |
829 return VKEY_MEDIA_LAUNCH_APP2; | 831 return VKEY_MEDIA_LAUNCH_APP2; |
830 | |
831 // XF86XK_Tools is generated from HID Usage AL_CONSUMER_CONTROL_CONFIG | |
832 // (Usage 0x0183, Page 0x0C) and most commonly launches the OS default | |
833 // media player (see crbug.com/398345). | |
834 case XF86XK_Tools: | |
835 return VKEY_MEDIA_LAUNCH_MEDIA_SELECT; | |
836 | |
837 case XF86XK_WLAN: | 832 case XF86XK_WLAN: |
838 return VKEY_WLAN; | 833 return VKEY_WLAN; |
839 case XF86XK_PowerOff: | 834 case XF86XK_PowerOff: |
840 return VKEY_POWER; | 835 return VKEY_POWER; |
841 case XF86XK_Sleep: | 836 case XF86XK_Sleep: |
842 return VKEY_SLEEP; | 837 return VKEY_SLEEP; |
843 case XF86XK_MonBrightnessDown: | 838 case XF86XK_MonBrightnessDown: |
844 return VKEY_BRIGHTNESS_DOWN; | 839 return VKEY_BRIGHTNESS_DOWN; |
845 case XF86XK_MonBrightnessUp: | 840 case XF86XK_MonBrightnessUp: |
846 return VKEY_BRIGHTNESS_UP; | 841 return VKEY_BRIGHTNESS_UP; |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 // alone does not map to XK_less; XKeysymToKeycode() returns KEY_102ND | 1358 // alone does not map to XK_less; XKeysymToKeycode() returns KEY_102ND |
1364 // (the '<>' key between Shift and Z on 105-key keyboards) which does. | 1359 // (the '<>' key between Shift and Z on 105-key keyboards) which does. |
1365 // | 1360 // |
1366 // crbug.com/386066 and crbug.com/390263 are examples of problems | 1361 // crbug.com/386066 and crbug.com/390263 are examples of problems |
1367 // associated with this. | 1362 // associated with this. |
1368 // | 1363 // |
1369 return XKeysymToKeycode(display, XKeysymForWindowsKeyCode(key_code, false)); | 1364 return XKeysymToKeycode(display, XKeysymForWindowsKeyCode(key_code, false)); |
1370 } | 1365 } |
1371 | 1366 |
1372 } // namespace ui | 1367 } // namespace ui |
OLD | NEW |