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

Unified Diff: ui/events/event.cc

Issue 1585193002: Build key map DomCodeToKey() for Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dtapuska's review, added more tests, handles non-printable key combination Created 4 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
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index 626c52cf5cc602abe53034e68f07564123822f69..f850abc2cdc0a136902f996459f175188e3fd7ea 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -37,6 +37,10 @@
#include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" // nogncheck
#endif
+#if defined(OS_WIN)
+#include "ui/events/keycodes/keyboard_lookup_win.h"
+#endif
+
namespace {
std::string EventTypeName(ui::EventType type) {
@@ -692,6 +696,9 @@ KeyEvent::KeyEvent(const base::NativeEvent& native_event)
// Only Windows has native character events.
if (is_char_)
key_ = DomKey::FromCharacter(native_event.wParam);
+ else
+ key_ = WindowsKeyboardLookup::VirtualKeyToCurrentLayoutDomKey(key_code_,
+ flags());
#endif
}

Powered by Google App Engine
This is Rietveld 408576698