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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
758 case XK_ugrave: | 758 case XK_ugrave: |
759 case XK_Ugrave: | 759 case XK_Ugrave: |
760 case XK_brokenbar: | 760 case XK_brokenbar: |
761 return VKEY_OEM_102; // international backslash key in 102 keyboard. | 761 return VKEY_OEM_102; // international backslash key in 102 keyboard. |
762 | 762 |
763 // When evdev is in use, /usr/share/X11/xkb/symbols/inet maps F13-18 keys | 763 // When evdev is in use, /usr/share/X11/xkb/symbols/inet maps F13-18 keys |
764 // to the special XF86XK symbols to support Microsoft Ergonomic keyboards: | 764 // to the special XF86XK symbols to support Microsoft Ergonomic keyboards: |
765 // https://bugs.freedesktop.org/show_bug.cgi?id=5783 | 765 // https://bugs.freedesktop.org/show_bug.cgi?id=5783 |
766 // In Chrome, we map these X key symbols back to F13-18 since we don't have | 766 // In Chrome, we map these X key symbols back to F13-18 since we don't have |
767 // VKEYs for these XF86XK symbols. | 767 // VKEYs for these XF86XK symbols. |
768 case XF86XK_Tools: | |
769 return VKEY_F13; | |
770 case XF86XK_Launch5: | 768 case XF86XK_Launch5: |
771 return VKEY_F14; | 769 return VKEY_F14; |
772 case XF86XK_Launch6: | 770 case XF86XK_Launch6: |
773 return VKEY_F15; | 771 return VKEY_F15; |
774 case XF86XK_Launch7: | 772 case XF86XK_Launch7: |
775 return VKEY_F16; | 773 return VKEY_F16; |
776 case XF86XK_Launch8: | 774 case XF86XK_Launch8: |
777 return VKEY_F17; | 775 return VKEY_F17; |
778 case XF86XK_Launch9: | 776 case XF86XK_Launch9: |
779 return VKEY_F18; | 777 return VKEY_F18; |
(...skipping 27 matching lines...) Expand all Loading... | |
807 return VKEY_MEDIA_STOP; | 805 return VKEY_MEDIA_STOP; |
808 case XF86XK_AudioPlay: | 806 case XF86XK_AudioPlay: |
809 return VKEY_MEDIA_PLAY_PAUSE; | 807 return VKEY_MEDIA_PLAY_PAUSE; |
810 case XF86XK_Mail: | 808 case XF86XK_Mail: |
811 return VKEY_MEDIA_LAUNCH_MAIL; | 809 return VKEY_MEDIA_LAUNCH_MAIL; |
812 case XF86XK_LaunchA: // F3 on an Apple keyboard. | 810 case XF86XK_LaunchA: // F3 on an Apple keyboard. |
813 return VKEY_MEDIA_LAUNCH_APP1; | 811 return VKEY_MEDIA_LAUNCH_APP1; |
814 case XF86XK_LaunchB: // F4 on an Apple keyboard. | 812 case XF86XK_LaunchB: // F4 on an Apple keyboard. |
815 case XF86XK_Calculator: | 813 case XF86XK_Calculator: |
816 return VKEY_MEDIA_LAUNCH_APP2; | 814 return VKEY_MEDIA_LAUNCH_APP2; |
815 | |
816 // XF86XK_Tools is generated from HID Usage AL_CONSUMER_CONTROL_CONFIG | |
817 // (Usage 0x0183, Page 0x0C) and most commonly launches the OS default | |
818 // media player (see crbug/398345). | |
Wez
2014/09/02 17:27:18
s/crbug/crbug.com
mmeisser
2014/09/09 14:20:52
Should I change something here ?
Wez
2014/09/10 03:38:51
Yes, please update the comment to say "(see crbug.
| |
819 case XF86XK_Tools: | |
820 return VKEY_MEDIA_LAUNCH_MEDIA_SELECT; | |
821 | |
817 case XF86XK_WLAN: | 822 case XF86XK_WLAN: |
818 return VKEY_WLAN; | 823 return VKEY_WLAN; |
819 case XF86XK_PowerOff: | 824 case XF86XK_PowerOff: |
820 return VKEY_POWER; | 825 return VKEY_POWER; |
821 case XF86XK_MonBrightnessDown: | 826 case XF86XK_MonBrightnessDown: |
822 return VKEY_BRIGHTNESS_DOWN; | 827 return VKEY_BRIGHTNESS_DOWN; |
823 case XF86XK_MonBrightnessUp: | 828 case XF86XK_MonBrightnessUp: |
824 return VKEY_BRIGHTNESS_UP; | 829 return VKEY_BRIGHTNESS_UP; |
825 case XF86XK_KbdBrightnessDown: | 830 case XF86XK_KbdBrightnessDown: |
826 return VKEY_KBD_BRIGHTNESS_DOWN; | 831 return VKEY_KBD_BRIGHTNESS_DOWN; |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1348 // alone does not map to XK_less; XKeysymToKeycode() returns KEY_102ND | 1353 // alone does not map to XK_less; XKeysymToKeycode() returns KEY_102ND |
1349 // (the '<>' key between Shift and Z on 105-key keyboards) which does. | 1354 // (the '<>' key between Shift and Z on 105-key keyboards) which does. |
1350 // | 1355 // |
1351 // crbug.com/386066 and crbug.com/390263 are examples of problems | 1356 // crbug.com/386066 and crbug.com/390263 are examples of problems |
1352 // associated with this. | 1357 // associated with this. |
1353 // | 1358 // |
1354 return XKeysymToKeycode(display, XKeysymForWindowsKeyCode(key_code, false)); | 1359 return XKeysymToKeycode(display, XKeysymForWindowsKeyCode(key_code, false)); |
1355 } | 1360 } |
1356 | 1361 |
1357 } // namespace ui | 1362 } // namespace ui |
OLD | NEW |