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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 753 case XK_guillemotleft: | 753 case XK_guillemotleft: |
| 754 case XK_guillemotright: | 754 case XK_guillemotright: |
| 755 case XK_degree: | 755 case XK_degree: |
| 756 // In the case of canadian multilingual keyboard layout, VKEY_OEM_102 is | 756 // In the case of canadian multilingual keyboard layout, VKEY_OEM_102 is |
| 757 // assigned to ugrave key. | 757 // assigned to ugrave key. |
| 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 |
|
Wez
2014/08/06 21:17:53
nit: Update this comment.
| |
| 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; |
| 780 | 778 |
| 779 // this was mapped to VKEY_F13 (see above), but this was causing odd | |
|
Wez
2014/08/06 21:17:53
nit: Capitalization.
| |
| 780 // behavior (trig lock screen) with all keyboard that send this usage | |
| 781 // in order to launch the media player(supported on Windows, Android) | |
| 782 // (see crbug=398345) | |
|
Wez
2014/08/06 21:17:53
nit: Rather than describe the bug, describe the lo
mmeisser
2014/08/07 17:46:41
I will describe the mapping. This seems odd, but a
| |
| 783 case XF86XK_Tools: | |
|
Wez
2014/08/06 21:17:53
Can you move this to the appropriate order in this
mmeisser
2014/08/07 17:46:41
The actual list of XK mappings are not really orde
| |
| 784 return VKEY_MEDIA_LAUNCH_MEDIA_SELECT; | |
| 785 | |
| 781 // For supporting multimedia buttons on a USB keyboard. | 786 // For supporting multimedia buttons on a USB keyboard. |
| 782 case XF86XK_Back: | 787 case XF86XK_Back: |
| 783 return VKEY_BROWSER_BACK; | 788 return VKEY_BROWSER_BACK; |
| 784 case XF86XK_Forward: | 789 case XF86XK_Forward: |
| 785 return VKEY_BROWSER_FORWARD; | 790 return VKEY_BROWSER_FORWARD; |
| 786 case XF86XK_Reload: | 791 case XF86XK_Reload: |
| 787 return VKEY_BROWSER_REFRESH; | 792 return VKEY_BROWSER_REFRESH; |
| 788 case XF86XK_Stop: | 793 case XF86XK_Stop: |
| 789 return VKEY_BROWSER_STOP; | 794 return VKEY_BROWSER_STOP; |
| 790 case XF86XK_Search: | 795 case XF86XK_Search: |
| (...skipping 557 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 |