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

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

Issue 8964011: Do not use ui::GetCharacterFromXEvent when Control is pressed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « ui/base/ime/input_method_ibus.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/mock_input_method.cc
diff --git a/ui/base/ime/mock_input_method.cc b/ui/base/ime/mock_input_method.cc
index 9d5c7dc564177d82e98ae97ca2b28ae16bf8df64..5087b98b61394056644db0974a9db8c1c4eb18ed 100644
--- a/ui/base/ime/mock_input_method.cc
+++ b/ui/base/ime/mock_input_method.cc
@@ -62,8 +62,7 @@ void MockInputMethod::DispatchKeyEvent(const base::NativeEvent& native_event) {
// On key release, just dispatch it.
delegate_->DispatchKeyEventPostIME(native_event);
} else {
- const uint32 state =
- EventFlagsFromXFlags(reinterpret_cast<XKeyEvent*>(native_event)->state);
+ const uint32 state = EventFlagsFromXFlags(native_event->xkey.state);
if (consume_next_key_) {
// Send the VKEY_PROCESSKEY RawKeyDown event.
SendFakeProcessKeyEvent(true, state);
@@ -73,7 +72,9 @@ void MockInputMethod::DispatchKeyEvent(const base::NativeEvent& native_event) {
if (text_input_client_) {
// then send a Char event via ui::TextInputClient.
const KeyboardCode key_code = ui::KeyboardCodeFromNative(native_event);
- uint16 ch = ui::GetCharacterFromXEvent(native_event);
+ uint16 ch = 0;
+ if (!(state & ui::EF_CONTROL_DOWN))
+ ch = ui::GetCharacterFromXEvent(native_event);
if (!ch)
ch = ui::GetCharacterFromKeyCode(key_code, state);
if (ch)
« no previous file with comments | « ui/base/ime/input_method_ibus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698