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

Side by Side Diff: ui/events/keycodes/keyboard_code_conversion_xkb.cc

Issue 1427743003: Alt remapping doesn't work when Shift is pressed on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_xkb.h" 5 #include "ui/events/keycodes/keyboard_code_conversion_xkb.h"
6 6
7 #include "ui/events/keycodes/dom/dom_key.h" 7 #include "ui/events/keycodes/dom/dom_key.h"
8 #include "ui/events/keycodes/keyboard_code_conversion.h" 8 #include "ui/events/keycodes/keyboard_code_conversion.h"
9 9
10 #ifndef XK_dead_greek 10 #ifndef XK_dead_greek
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 case XKB_KEY_F24: 188 case XKB_KEY_F24:
189 return DomKey::F24; 189 return DomKey::F24;
190 case XKB_KEY_Shift_L: 190 case XKB_KEY_Shift_L:
191 case XKB_KEY_Shift_R: 191 case XKB_KEY_Shift_R:
192 return DomKey::SHIFT; 192 return DomKey::SHIFT;
193 case XKB_KEY_Control_L: 193 case XKB_KEY_Control_L:
194 case XKB_KEY_Control_R: 194 case XKB_KEY_Control_R:
195 return DomKey::CONTROL; 195 return DomKey::CONTROL;
196 case XKB_KEY_Caps_Lock: 196 case XKB_KEY_Caps_Lock:
197 return DomKey::CAPS_LOCK; 197 return DomKey::CAPS_LOCK;
198 #if defined(OS_CHROMEOS)
199 case XKB_KEY_Meta_L:
200 case XKB_KEY_Meta_R:
201 case XKB_KEY_Alt_L:
202 case XKB_KEY_Alt_R:
203 // The Shift+Alt generates a KeySym for the Meta key. On ChromeOS the Meta
204 // key is not used and we should still get the Alt key. crbug.com/541468.
205 return DomKey::ALT;
206 #else
198 case XKB_KEY_Meta_L: 207 case XKB_KEY_Meta_L:
199 case XKB_KEY_Meta_R: 208 case XKB_KEY_Meta_R:
200 return DomKey::META; 209 return DomKey::META;
201 case XKB_KEY_Alt_L: 210 case XKB_KEY_Alt_L:
202 case XKB_KEY_Alt_R: 211 case XKB_KEY_Alt_R:
203 return DomKey::ALT; 212 return DomKey::ALT;
213 #endif // defined(OS_CHROMEOS)
204 case XKB_KEY_Super_L: 214 case XKB_KEY_Super_L:
205 case XKB_KEY_Super_R: 215 case XKB_KEY_Super_R:
206 return DomKey::OS; 216 return DomKey::OS;
207 case XKB_KEY_Hyper_L: 217 case XKB_KEY_Hyper_L:
208 case XKB_KEY_Hyper_R: 218 case XKB_KEY_Hyper_R:
209 return DomKey::HYPER; 219 return DomKey::HYPER;
210 case XKB_KEY_Delete: 220 case XKB_KEY_Delete:
211 return DomKey::DEL; 221 return DomKey::DEL;
212 case XKB_KEY_SunProps: 222 case XKB_KEY_SunProps:
213 return DomKey::PROPS; 223 return DomKey::PROPS;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 } 471 }
462 472
463 DomKey XKeySymToDomKey(xkb_keysym_t keysym, base::char16 character) { 473 DomKey XKeySymToDomKey(xkb_keysym_t keysym, base::char16 character) {
464 DomKey dom_key = NonPrintableXKeySymToDomKey(keysym); 474 DomKey dom_key = NonPrintableXKeySymToDomKey(keysym);
465 if (dom_key != DomKey::NONE) 475 if (dom_key != DomKey::NONE)
466 return dom_key; 476 return dom_key;
467 return DomKey::FromCharacter(character); 477 return DomKey::FromCharacter(character);
468 } 478 }
469 479
470 } // namespace ui 480 } // 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