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

Unified Diff: ui/events/event.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/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index d0966da00847a13bcfe64258596a445fa57bd0e4..fbb12c6b2d97545296fc8414d10ee55012f1ca20 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -782,8 +782,14 @@ void KeyEvent::ApplyLayout() const {
// TODO(kpschoedel): set key_ field for X11.
#elif defined(USE_OZONE)
kpschoedel 2015/01/26 19:34:22 This code isn't run for normal key events (only fo
KeyboardCode key_code;
- if (!KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup(
+ if (KeyboardLayoutEngineManager::GetKeyboardLayoutEngine()->Lookup(
code_, flags(), &key_, &character_, &key_code, &platform_keycode_)) {
+ if (IsControlDown()) {
+ // Use GetCharacterFromKeyCode() to set |character_| to 0x0 for keys that
+ // we do not care about.
+ character_ = GetCharacterFromKeyCode(key_code_, flags());
+ }
+ } else {
GetMeaningFromKeyCode(key_code_, flags(), &key_, &character_);
}
#else
« 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