Chromium Code Reviews| 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 mapped from HID usage AL_CONSUMER_CONTROL_CONFIG | |
| 817 // (consumer page 0x0C, usage 0x0183) and is mostly used to launch a | |
| 818 // media player app in most common OS (see crbug=398345) | |
|
Wez
2014/08/26 19:19:36
Suggest "is mapped from" -> "is generated by"
Sugg
| |
| 819 // map it now to VKEY_MEDIA_LAUNCH_MEDIA_SELECT which can be used to | |
|
Wez
2014/08/26 19:19:36
What VKEY does that USB usage generate under Windo
| |
| 820 // later launch a media player app. | |
|
Wez
2014/08/26 19:19:36
Remove this?
| |
| 821 case XF86XK_Tools: | |
| 822 return VKEY_MEDIA_LAUNCH_MEDIA_SELECT; | |
| 823 | |
| 817 case XF86XK_WLAN: | 824 case XF86XK_WLAN: |
| 818 return VKEY_WLAN; | 825 return VKEY_WLAN; |
| 819 case XF86XK_PowerOff: | 826 case XF86XK_PowerOff: |
| 820 return VKEY_POWER; | 827 return VKEY_POWER; |
| 821 case XF86XK_MonBrightnessDown: | 828 case XF86XK_MonBrightnessDown: |
| 822 return VKEY_BRIGHTNESS_DOWN; | 829 return VKEY_BRIGHTNESS_DOWN; |
| 823 case XF86XK_MonBrightnessUp: | 830 case XF86XK_MonBrightnessUp: |
| 824 return VKEY_BRIGHTNESS_UP; | 831 return VKEY_BRIGHTNESS_UP; |
| 825 case XF86XK_KbdBrightnessDown: | 832 case XF86XK_KbdBrightnessDown: |
| 826 return VKEY_KBD_BRIGHTNESS_DOWN; | 833 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 | 1355 // alone does not map to XK_less; XKeysymToKeycode() returns KEY_102ND |
| 1349 // (the '<>' key between Shift and Z on 105-key keyboards) which does. | 1356 // (the '<>' key between Shift and Z on 105-key keyboards) which does. |
| 1350 // | 1357 // |
| 1351 // crbug.com/386066 and crbug.com/390263 are examples of problems | 1358 // crbug.com/386066 and crbug.com/390263 are examples of problems |
| 1352 // associated with this. | 1359 // associated with this. |
| 1353 // | 1360 // |
| 1354 return XKeysymToKeycode(display, XKeysymForWindowsKeyCode(key_code, false)); | 1361 return XKeysymToKeycode(display, XKeysymForWindowsKeyCode(key_code, false)); |
| 1355 } | 1362 } |
| 1356 | 1363 |
| 1357 } // namespace ui | 1364 } // namespace ui |
| OLD | NEW |