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

Unified Diff: ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc

Issue 2481413006: Checks the DomKey in the non-printable map to determine whether a key event is non-character. (Closed)
Patch Set: Checks the DomKey in the non-printable map to determine whether a key event is non-character. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6d65dba68c7f44fd2a5d0710c183f6afaa1d24f0..3ceea8f4cacb4896cefc35e031707e75dcfdcd4e 100644
--- a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
+++ b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
@@ -752,19 +752,20 @@ bool XkbKeyboardLayoutEngine::Lookup(DomCode dom_code,
return false;
// Classify the keysym and convert to DOM and VKEY representations.
- if ((character == 0) &&
- ((xkb_keysym != XKB_KEY_at) || (flags & EF_CONTROL_DOWN) == 0)) {
+ if (xkb_keysym != XKB_KEY_at || (flags & EF_CONTROL_DOWN) == 0) {
// Non-character key. (We only support NUL as ^@.)
*dom_key = NonPrintableXKeySymToDomKey(xkb_keysym);
- if (*dom_key == DomKey::NONE) {
- *dom_key = DomKey::UNIDENTIFIED;
- *key_code = VKEY_UNKNOWN;
- } else {
+ if (*dom_key != DomKey::NONE) {
*key_code = NonPrintableDomKeyToKeyboardCode(*dom_key);
+ if (*key_code == VKEY_UNKNOWN)
+ *key_code = DomCodeToUsLayoutNonLocatedKeyboardCode(dom_code);
+ return true;
}
- if (*key_code == VKEY_UNKNOWN)
+ if (character == 0) {
+ *dom_key = DomKey::UNIDENTIFIED;
*key_code = DomCodeToUsLayoutNonLocatedKeyboardCode(dom_code);
- return true;
+ return true;
+ }
}
// Per UI Events rules for determining |key|, if the character is
« no previous file with comments | « no previous file | ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698