From 501ebf0409b21006e224116a324f18ad94edc725 Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Thu, 17 Dec 2009 18:49:56 +0000 Subject: Use KF_ALTDOWN flag instead of GetKeyState(VK_MENU) KF_ALTDOWN is more accurate than GetKeyState(VK_MENU). When usre presses RightShift+RightAlt, the fake VK_CONTROL generated carries KF_ALTDOWN in its flags but GetKeyState(VK_MENU) is clear. BUG=30244 TEST=Verify RightAlt+RightShift does not change to RTL and issue 24888 does not regress. However, RightShift+RightAlt still changes RTL as this is the behavior of richedit. Review URL: http://codereview.chromium.org/505026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34850 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/autocomplete/autocomplete_edit_view_win.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index c00d5f3..7ee0b0f 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -1319,7 +1319,7 @@ void AutocompleteEditViewWin::OnKeyUp(TCHAR key, // To work around this, if the user hits ctrl+shift, we pass it to // DefWindowProc() while the edit is empty, which toggles the default reading // order; then we restore the user's input. - if ((GetKeyState(VK_MENU) == 0) && + if (!(flags & KF_ALTDOWN) && (((key == VK_CONTROL) && (GetKeyState(VK_SHIFT) < 0)) || ((key == VK_SHIFT) && (GetKeyState(VK_CONTROL) < 0)))) { ScopedFreeze freeze(this, GetTextObjectModel()); -- cgit v1.1