| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |