OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ozone/layout/xkb/xkb_keyboard_code_conversion.h" | |
6 | |
7 #include "ui/events/keycodes/dom3/dom_key.h" | 5 #include "ui/events/keycodes/dom3/dom_key.h" |
| 6 #include "ui/events/keycodes/keyboard_code_conversion.h" |
| 7 #include "ui/events/keycodes/keyboard_code_conversion_xkb.h" |
8 | 8 |
9 namespace ui { | 9 namespace ui { |
10 | 10 |
11 DomKey NonPrintableXkbKeySymToDomKey(xkb_keysym_t keysym) { | 11 DomKey NonPrintableXkbKeySymToDomKey(xkb_keysym_t keysym) { |
12 switch (keysym) { | 12 switch (keysym) { |
13 case XKB_KEY_BackSpace: | 13 case XKB_KEY_BackSpace: |
14 return DomKey::BACKSPACE; | 14 return DomKey::BACKSPACE; |
15 case XKB_KEY_Tab: | 15 case XKB_KEY_Tab: |
16 case XKB_KEY_KP_Tab: | 16 case XKB_KEY_KP_Tab: |
17 case XKB_KEY_ISO_Left_Tab: | 17 case XKB_KEY_ISO_Left_Tab: |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 return 0x0785; // combining inverted breve | 437 return 0x0785; // combining inverted breve |
438 case XKB_KEY_dead_belowcomma: | 438 case XKB_KEY_dead_belowcomma: |
439 return 0x0806; // combining comma below | 439 return 0x0806; // combining comma below |
440 case XKB_KEY_dead_currency: | 440 case XKB_KEY_dead_currency: |
441 return 0x0164; // currency sign | 441 return 0x0164; // currency sign |
442 default: | 442 default: |
443 return 0; | 443 return 0; |
444 } | 444 } |
445 } | 445 } |
446 | 446 |
| 447 DomKey XkbKeySymToDomKey(xkb_keysym_t keysym, base::char16 character) { |
| 448 DomKey dom_key = NonPrintableXkbKeySymToDomKey(keysym); |
| 449 if (dom_key == DomKey::NONE) |
| 450 dom_key = CharacterToDomKey(character); |
| 451 return dom_key; |
| 452 } |
| 453 |
447 } // namespace ui | 454 } // namespace ui |
OLD | NEW |