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

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: Cleaned API, added unittest 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
« no previous file with comments | « no previous file | ui/events/events.gyp » ('j') | ui/events/events.gyp » ('J')
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 66d42780a1e9387ee5b28b371560d480755cda11..0a5d783acd9af48b349dad8cf339c72db1d598c8 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) {
@@ -697,6 +701,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
}
« no previous file with comments | « no previous file | ui/events/events.gyp » ('j') | ui/events/events.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698