diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-13 19:02:03 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-13 19:02:03 +0000 |
commit | 105b8cdd6bceee8ee86499ae377186ff1ec7df7b (patch) | |
tree | 06af9372cfb822b5eaef3f0ed12c36e6c6bde9f8 /ui/base/ime/mock_input_method.cc | |
parent | 597cc597c4f92491e4968c37c2ab021298b8f0d6 (diff) | |
download | chromium_src-105b8cdd6bceee8ee86499ae377186ff1ec7df7b.zip chromium_src-105b8cdd6bceee8ee86499ae377186ff1ec7df7b.tar.gz chromium_src-105b8cdd6bceee8ee86499ae377186ff1ec7df7b.tar.bz2 |
Ensure that the Alt key is handled correctly in Windows desktop AURA.
The Alt key on its own sends the WM_SYSKEYDOWN/UP messages to the queue. These messages have
to be defproc'ed to get the WM_SYSCOMMAND with SC_KEYMENU to be posted to the queue which is where
Chrome sets the focus to the menu bar.
Alt Space sends in the WM_SYSCHAR message which has to be defproc'ed to get the WM_SYSCOMMAND which
when defproc'ed displays the system menu.
This works well on non AURA chrome. In AURA chrome, we always set keyboard and char messages as handled
which results in the WM_SYSCOMMAND message not coming in thus leading to the problem.
Fix is to return a bool from the InputMethodDelegate interface methods DispatchKeyEventPostIME and
DispatchFabricatedKeyEventPostIME and to ensure that the return values from these code paths correctly reflect
whether the event was handled or not.
In the InputMethodEventFilter::OnKeyEvent function we check if the event was handled before stopping propagation.
On Windows when we return false from the keyevent handling the message would be defproc'ed which ensures that Alt is
handled correctly.
To handle WM_SYSCHAR with VK_SPACE, i.e. Alt + Space which brings up the sysmenu on Windows, a change was made to the
InputMethodWin::OnChar function where we explicitly check for this message and set handled to false. This is the only
WM_SYSCHAR message we need to handle.
Fixes bug https://code.google.com/p/chromium/issues/detail?id=181303
BUG=181303
R=cpu
TEST=Covered by interactive browser tests TestAltMenuKeyboardAccessFocusOmnibox and TestSystemMenuWithKeyboard
Review URL: https://codereview.chromium.org/12669003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/ime/mock_input_method.cc')
-rw-r--r-- | ui/base/ime/mock_input_method.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/base/ime/mock_input_method.cc b/ui/base/ime/mock_input_method.cc index 933386f..4dd6c57 100644 --- a/ui/base/ime/mock_input_method.cc +++ b/ui/base/ime/mock_input_method.cc @@ -24,10 +24,12 @@ TextInputClient* MockInputMethod::GetTextInputClient() const { return text_input_client_; } -void MockInputMethod::DispatchKeyEvent(const base::NativeEvent& native_event) { +bool MockInputMethod::DispatchKeyEvent(const base::NativeEvent& native_event) { + return false; } -void MockInputMethod::DispatchFabricatedKeyEvent(const ui::KeyEvent& event) { +bool MockInputMethod::DispatchFabricatedKeyEvent(const ui::KeyEvent& event) { + return false; } void MockInputMethod::Init(bool focused) { |