Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: ui/base/keycodes/keyboard_code_conversion_x.cc

Issue 12211127: Fix international-backslash key in Canadian French keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/keycodes/keyboard_code_conversion_x.h" 5 #include "ui/base/keycodes/keyboard_code_conversion_x.h"
6 6
7 #define XK_3270 // for XK_3270_BackTab 7 #define XK_3270 // for XK_3270_BackTab
8 #include <X11/keysym.h> 8 #include <X11/keysym.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/Xutil.h> 10 #include <X11/Xutil.h>
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 case XK_F22: 329 case XK_F22:
330 case XK_F23: 330 case XK_F23:
331 case XK_F24: 331 case XK_F24:
332 return static_cast<KeyboardCode>(VKEY_F1 + (keysym - XK_F1)); 332 return static_cast<KeyboardCode>(VKEY_F1 + (keysym - XK_F1));
333 case XK_KP_F1: 333 case XK_KP_F1:
334 case XK_KP_F2: 334 case XK_KP_F2:
335 case XK_KP_F3: 335 case XK_KP_F3:
336 case XK_KP_F4: 336 case XK_KP_F4:
337 return static_cast<KeyboardCode>(VKEY_F1 + (keysym - XK_KP_F1)); 337 return static_cast<KeyboardCode>(VKEY_F1 + (keysym - XK_KP_F1));
338 338
339 case XK_guillemotleft:
340 case XK_guillemotright:
341 case XK_degree:
342 return VKEY_OEM_102; // international backslash key in 102 keyboard.
343
339 // When evdev is in use, /usr/share/X11/xkb/symbols/inet maps F13-18 keys 344 // When evdev is in use, /usr/share/X11/xkb/symbols/inet maps F13-18 keys
340 // to the special XF86XK symbols to support Microsoft Ergonomic keyboards: 345 // to the special XF86XK symbols to support Microsoft Ergonomic keyboards:
341 // https://bugs.freedesktop.org/show_bug.cgi?id=5783 346 // https://bugs.freedesktop.org/show_bug.cgi?id=5783
342 // In Chrome, we map these X key symbols back to F13-18 since we don't have 347 // In Chrome, we map these X key symbols back to F13-18 since we don't have
343 // VKEYs for these XF86XK symbols. 348 // VKEYs for these XF86XK symbols.
344 case XF86XK_Tools: 349 case XF86XK_Tools:
345 return VKEY_F13; 350 return VKEY_F13;
346 case XF86XK_Launch5: 351 case XF86XK_Launch5:
347 return VKEY_F14; 352 return VKEY_F14;
348 case XF86XK_Launch6: 353 case XF86XK_Launch6:
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 XK_F10, // 0x4C: XK_F10 519 XK_F10, // 0x4C: XK_F10
515 XK_Num_Lock, // 0x4D: XK_Num_Lock 520 XK_Num_Lock, // 0x4D: XK_Num_Lock
516 XK_Scroll_Lock, // 0x4E: XK_Scroll_Lock 521 XK_Scroll_Lock, // 0x4E: XK_Scroll_Lock
517 }; 522 };
518 523
519 return hardware_code < arraysize(kHardwareKeycodeMap) ? 524 return hardware_code < arraysize(kHardwareKeycodeMap) ?
520 kHardwareKeycodeMap[hardware_code] : 0; 525 kHardwareKeycodeMap[hardware_code] : 0;
521 } 526 }
522 527
523 // TODO(jcampan): this method might be incomplete. 528 // TODO(jcampan): this method might be incomplete.
524 int XKeysymForWindowsKeyCode(KeyboardCode keycode, bool shift) { 529 int XKeysymForWindowsKeyCode(KeyboardCode keycode, bool shift) {
Yusuke Sato 2013/02/13 00:45:58 please update this function too.
Seigo Nonaka 2013/02/13 01:02:28 Done.
525 switch (keycode) { 530 switch (keycode) {
526 case VKEY_NUMPAD0: 531 case VKEY_NUMPAD0:
527 return XK_KP_0; 532 return XK_KP_0;
528 case VKEY_NUMPAD1: 533 case VKEY_NUMPAD1:
529 return XK_KP_1; 534 return XK_KP_1;
530 case VKEY_NUMPAD2: 535 case VKEY_NUMPAD2:
531 return XK_KP_2; 536 return XK_KP_2;
532 case VKEY_NUMPAD3: 537 case VKEY_NUMPAD3:
533 return XK_KP_3; 538 return XK_KP_3;
534 case VKEY_NUMPAD4: 539 case VKEY_NUMPAD4:
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 case VKEY_KBD_BRIGHTNESS_UP: 780 case VKEY_KBD_BRIGHTNESS_UP:
776 return XF86XK_KbdBrightnessUp; 781 return XF86XK_KbdBrightnessUp;
777 782
778 default: 783 default:
779 LOG(WARNING) << "Unknown keycode:" << keycode; 784 LOG(WARNING) << "Unknown keycode:" << keycode;
780 return 0; 785 return 0;
781 } 786 }
782 } 787 }
783 788
784 } // namespace ui 789 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698