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

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

Issue 872213002: [Ozone] Fix ui::Event::GetCharacter() when Ctrl is pressed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 bf7d1586981a47f30ff5ac6957726762735b3f62..559463f6a55712a9190a70428feb388e517aabb5 100644
--- a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
+++ b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
@@ -17,6 +17,7 @@
#include "ui/events/keycodes/dom3/dom_code.h"
#include "ui/events/keycodes/dom3/dom_key.h"
#include "ui/events/keycodes/dom4/keycode_converter.h"
+#include "ui/events/keycodes/keyboard_code_conversion.h"
#include "ui/events/ozone/layout/layout_util.h"
#include "ui/events/ozone/layout/xkb/xkb_keyboard_code_conversion.h"
@@ -774,6 +775,12 @@ bool XkbKeyboardLayoutEngine::Lookup(DomCode dom_code,
if (*key_code == VKEY_UNKNOWN)
*key_code = DomCodeToNonLocatedKeyboardCode(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.
+ *character = GetCharacterFromKeyCode(*key_code, flags);
+ }
} else if (*dom_key == DomKey::DEAD) {
*character = DeadXkbKeySymToCombiningCharacter(xkb_keysym);
*key_code = DomCodeToNonLocatedKeyboardCode(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