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

Unified Diff: ui/base/ime/input_method_win.cc

Issue 1921213005: Only overwrite DomKey of keydown event if it's a printable character (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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/base/ime/input_method_win.cc
diff --git a/ui/base/ime/input_method_win.cc b/ui/base/ime/input_method_win.cc
index 47160e570a4f37c6c6e17aadc4c2d2b891fa27bf..df9ac66f233be27a58779b4dda305aad2fba142d 100644
--- a/ui/base/ime/input_method_win.cc
+++ b/ui/base/ime/input_method_win.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <cwctype>
#include "base/auto_reset.h"
#include "base/command_line.h"
@@ -166,7 +167,8 @@ void InputMethodWin::DispatchKeyEvent(ui::KeyEvent* event) {
}
// If only 1 WM_CHAR per the key event, set it as the character of it.
- if (char_msgs.size() == 1)
+ if (char_msgs.size() == 1 &&
+ !std::iswcntrl(static_cast<wint_t>(char_msgs[0].wParam)))
event->set_character(static_cast<base::char16>(char_msgs[0].wParam));
// Dispatches the key events to the Chrome IME extension which is listening to
« 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