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

Unified Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

Issue 466223004: Set correct DOM key code string for functional keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/base/ime/chromeos/ime_keymap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/input_method_engine.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc
index 43ab99efb1cd2a40d89f407e0f5811aed170d059..2d6a7ca8df2719506b085f67a3a2d23b594a433e 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine.cc
@@ -29,6 +29,7 @@
#include "ui/base/ime/chromeos/ime_keymap.h"
#include "ui/events/event.h"
#include "ui/events/event_processor.h"
+#include "ui/events/keycodes/dom4/keycode_converter.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_util.h"
@@ -99,7 +100,11 @@ void GetExtensionKeyboardEventFromKeyEvent(
DCHECK(ext_event);
ext_event->type = (event.type() == ui::ET_KEY_RELEASED) ? "keyup" : "keydown";
- ext_event->code = event.code();
+ std::string dom_code = event.code();
+ if (dom_code ==
+ ui::KeycodeConverter::GetInstance()->InvalidKeyboardEventCode())
+ dom_code = ui::KeyboardCodeToDomKeycode(event.key_code());
+ ext_event->code = dom_code;
ext_event->key_code = static_cast<int>(event.key_code());
ext_event->alt_key = event.IsAltDown();
ext_event->ctrl_key = event.IsControlDown();
« no previous file with comments | « no previous file | ui/base/ime/chromeos/ime_keymap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698