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

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

Issue 1110693002: Revise Control+key restriction for XKB layouts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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 | no next file » | 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 0660dd1f48e0f6c790513ddd0c89bbc14ed8960d..0b4cb734650d6806c59fceba88188455c016bac9 100644
--- a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
+++ b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
@@ -775,12 +775,10 @@ bool XkbKeyboardLayoutEngine::Lookup(DomCode dom_code,
if (*key_code == VKEY_UNKNOWN)
*key_code = DomCodeToUsLayoutKeyboardCode(dom_code);
}
-
- if ((flags & EF_CONTROL_DOWN) == EF_CONTROL_DOWN) {
- // 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);
- }
+ // If the Control key is down, only allow ASCII control characters to be
+ // returned, regardless of the key layout. crbug.com/450849
+ if ((flags & EF_CONTROL_DOWN) && (*character >= 0x20))
+ *character = 0;
} else if (*dom_key == DomKey::DEAD) {
*character = DeadXkbKeySymToCombiningCharacter(xkb_keysym);
*key_code = DomCodeToUsLayoutKeyboardCode(dom_code);
« 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