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

Side by Side Diff: ui/base/ime/input_method_win.cc

Issue 404203003: Distinguish between keystroke and character events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsCharFromNative() for Mac build 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/ime/input_method_win.h" 5 #include "ui/base/ime/input_method_win.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "ui/base/ime/text_input_client.h" 8 #include "ui/base/ime/text_input_client.h"
9 #include "ui/base/ime/win/tsf_input_scope.h" 9 #include "ui/base/ime/win/tsf_input_scope.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (native_key_event.message == WM_CHAR) { 112 if (native_key_event.message == WM_CHAR) {
113 BOOL handled; 113 BOOL handled;
114 OnChar(native_key_event.hwnd, native_key_event.message, 114 OnChar(native_key_event.hwnd, native_key_event.message,
115 native_key_event.wParam, native_key_event.lParam, &handled); 115 native_key_event.wParam, native_key_event.lParam, &handled);
116 return !!handled; // Don't send WM_CHAR for post event processing. 116 return !!handled; // Don't send WM_CHAR for post event processing.
117 } 117 }
118 // Handles ctrl-shift key to change text direction and layout alignment. 118 // Handles ctrl-shift key to change text direction and layout alignment.
119 if (ui::IMM32Manager::IsRTLKeyboardLayoutInstalled() && 119 if (ui::IMM32Manager::IsRTLKeyboardLayoutInstalled() &&
120 !IsTextInputTypeNone()) { 120 !IsTextInputTypeNone()) {
121 // TODO: shouldn't need to generate a KeyEvent here. 121 // TODO: shouldn't need to generate a KeyEvent here.
122 const ui::KeyEvent key(native_key_event, 122 const ui::KeyEvent key(native_key_event);
123 native_key_event.message == WM_CHAR);
124 ui::KeyboardCode code = key.key_code(); 123 ui::KeyboardCode code = key.key_code();
125 if (key.type() == ui::ET_KEY_PRESSED) { 124 if (key.type() == ui::ET_KEY_PRESSED) {
126 if (code == ui::VKEY_SHIFT) { 125 if (code == ui::VKEY_SHIFT) {
127 base::i18n::TextDirection dir; 126 base::i18n::TextDirection dir;
128 if (ui::IMM32Manager::IsCtrlShiftPressed(&dir)) 127 if (ui::IMM32Manager::IsCtrlShiftPressed(&dir))
129 pending_requested_direction_ = dir; 128 pending_requested_direction_ = dir;
130 } else if (code != ui::VKEY_CONTROL) { 129 } else if (code != ui::VKEY_CONTROL) {
131 pending_requested_direction_ = base::i18n::UNKNOWN_DIRECTION; 130 pending_requested_direction_ = base::i18n::UNKNOWN_DIRECTION;
132 } 131 }
133 } else if (key.type() == ui::ET_KEY_RELEASED && 132 } else if (key.type() == ui::ET_KEY_RELEASED &&
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 enabled_ = true; 607 enabled_ = true;
609 break; 608 break;
610 } 609 }
611 610
612 imm32_manager_.SetTextInputMode(window_handle, text_input_mode); 611 imm32_manager_.SetTextInputMode(window_handle, text_input_mode);
613 tsf_inputscope::SetInputScopeForTsfUnawareWindow( 612 tsf_inputscope::SetInputScopeForTsfUnawareWindow(
614 window_handle, text_input_type, text_input_mode); 613 window_handle, text_input_type, text_input_mode);
615 } 614 }
616 615
617 } // namespace ui 616 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_chromeos_unittest.cc ('k') | ui/base/ime/remote_input_method_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698