summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 07:19:48 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 07:19:48 +0000
commit33bfdcd50dfc47eefb45950ce0d00fdff5b03f7e (patch)
tree756779ff7cbdad680c7af630b7339d325798289b /views
parent4623008bc617720e7d4166582387bee26707fd83 (diff)
downloadchromium_src-33bfdcd50dfc47eefb45950ce0d00fdff5b03f7e.zip
chromium_src-33bfdcd50dfc47eefb45950ce0d00fdff5b03f7e.tar.gz
chromium_src-33bfdcd50dfc47eefb45950ce0d00fdff5b03f7e.tar.bz2
A quick fix for Issue 45091.
This change checks the states of ctrl and shift keys when proceesing acclerators to prevent FocusManager from consuming ctrl+alt keys and shift+alt keys. Windows sends SC_KEYMENU commands not only when we type only an alt key but also when we type ctrl+alt keys and shift+alt keys, both are used for changing input languages and keyboard layouts. To prevent these keys from being accidentally consumed by FocusManager, we check the states of these keys and send them to FocusManager. BUG=45091 TEST=interactive_ui_tests.exe --gtest_filter=KeyboardAccessTest.TestShiftAltMenuKeyboardAccess. Review URL: http://codereview.chromium.org/3318022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/window/window_win.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/views/window/window_win.cc b/views/window/window_win.cc
index 6aa5224..c81fe27 100644
--- a/views/window/window_win.cc
+++ b/views/window/window_win.cc
@@ -1121,8 +1121,12 @@ void WindowWin::OnSysCommand(UINT notification_code, CPoint click) {
// Handle SC_KEYMENU, which means that the user has pressed the ALT
// key and released it, so we should focus the menu bar.
if ((notification_code & sc_mask) == SC_KEYMENU && click.x == 0) {
+ // Retrieve the status of shift and control keys to prevent consuming
+ // shift+alt keys, which are used by Windows to change input languages.
Accelerator accelerator(app::KeyboardCodeForWindowsKeyCode(VK_MENU),
- false, false, false);
+ !!(GetKeyState(VK_SHIFT) & 0x8000),
+ !!(GetKeyState(VK_CONTROL) & 0x8000),
+ false);
GetFocusManager()->ProcessAccelerator(accelerator);
return;
}