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

Unified Diff: ui/events/event.cc

Issue 815773003: For faked key events from virtual keyboard, the character is set but dom key is not set. In such ca… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index fc87ca68350777906afd6c130b322858bb938f8d..0b406531afef906b5e483494381b95c7200706d4 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -749,6 +749,14 @@ void KeyEvent::SetExtendedKeyEventData(scoped_ptr<ExtendedKeyEventData> data) {
}
void KeyEvent::ApplyLayout() const {
+ // If the client has set the character (e.g. faked key events from virtual
+ // keyboard), it's client's responsibility to set the dom key correctly.
+ // Otherwise, set the dom key as unidentified.
+ // Please refer to crbug.com/443889.
+ if (character_ != 0) {
+ key_ = DomKey::UNIDENTIFIED;
Shu Chen 2014/12/19 08:29:21 Not sure whether it's more appropriate to set as D
kpschoedel 2014/12/19 16:08:51 UNIDENTIFIED is fine for this CL, as it is defined
+ return;
+ }
#if defined(OS_WIN)
// Native Windows character events always have is_char_ == true,
// so this is a synthetic or native keystroke event.

Powered by Google App Engine
This is Rietveld 408576698