| Index: ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
|
| diff --git a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
|
| index 63b89fe67c6db5ea99326cf44591bc54e6a86211..2d47cafe2368ca7aa6bf46321379ea8fc879a958 100644
|
| --- a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
|
| +++ b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
|
| @@ -657,6 +657,17 @@ void LoadKeymap(const std::string& layout_name,
|
| }
|
| #endif
|
|
|
| +KeyboardCode DomCodeToUsLayoutKeyboardCode(DomCode dom_code) {
|
| + DomKey dummy_dom_key;
|
| + base::char16 dummy_character;
|
| + KeyboardCode key_code;
|
| + if (DomCodeToUsLayoutMeaning(dom_code, EF_NONE, &dummy_dom_key,
|
| + &dummy_character, &key_code)) {
|
| + return key_code;
|
| + }
|
| + return VKEY_UNKNOWN;
|
| +}
|
| +
|
| } // anonymous namespace
|
|
|
| XkbKeyCodeConverter::XkbKeyCodeConverter() {
|
| @@ -775,21 +786,21 @@ bool XkbKeyboardLayoutEngine::Lookup(DomCode dom_code,
|
| *key_code = DifficultKeyboardCode(dom_code, flags, xkb_keycode, xkb_flags,
|
| xkb_keysym, *dom_key, *character);
|
| if (*key_code == VKEY_UNKNOWN)
|
| - *key_code = DomCodeToNonLocatedKeyboardCode(dom_code);
|
| + *key_code = DomCodeToUsLayoutKeyboardCode(dom_code);
|
| }
|
|
|
| if ((flags & EF_CONTROL_DOWN) == EF_CONTROL_DOWN) {
|
| - // Use GetCharacterFromKeyCode() to set |character| to 0x0 for key codes
|
| - // that we do not care about.
|
| + // Use GetCharacterFromKeyCode() to set |character| to 0x0 for keys that
|
| + // are not part of the accepted set of Control+Key combinations.
|
| *character = GetCharacterFromKeyCode(*key_code, flags);
|
| }
|
| } else if (*dom_key == DomKey::DEAD) {
|
| *character = DeadXkbKeySymToCombiningCharacter(xkb_keysym);
|
| - *key_code = DomCodeToNonLocatedKeyboardCode(dom_code);
|
| + *key_code = DomCodeToUsLayoutKeyboardCode(dom_code);
|
| } else {
|
| *key_code = NonPrintableDomKeyToKeyboardCode(*dom_key);
|
| if (*key_code == VKEY_UNKNOWN)
|
| - *key_code = DomCodeToNonLocatedKeyboardCode(dom_code);
|
| + *key_code = DomCodeToUsLayoutKeyboardCode(dom_code);
|
| }
|
| return true;
|
| }
|
|
|