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

Issue 505026: Use KF_ALTDOWN flag instead of GetKeyState(VK_MENU) (Closed)

Created:
11 years ago by xiyuan
Modified:
9 years, 7 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews_googlegroups.com, ben+cc_chromium.org
Visibility:
Public.

Description

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. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34850

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M chrome/browser/autocomplete/autocomplete_edit_view_win.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
xiyuan
11 years ago (2009-12-16 23:11:32 UTC) #1
Peter Kasting
LGTM, and I'm sorry I didn't think of this the first time.
11 years ago (2009-12-16 23:33:50 UTC) #2
xiyuan
11 years ago (2009-12-16 23:51:27 UTC) #3
On 2009/12/16 23:33:50, Peter Kasting wrote:
> LGTM, and I'm sorry I didn't think of this the first time.

This is not a normal case that people would know. :) I did not know that Hebrew
IME would inject keystrokes. With Hebrew IME active, right alt would generate
four messages: fake VK_CONTROL down, VK_MENU down, fake VK_CONTROL sys key up,
then VK_MENU up. And the fake VK_CONTROL sys key up triggers our logic to send
down a VK_CONTROL key up which triggers RTL layout. GetKeyState(VK_MENU) works
if user release Alt key the last but not when it is released before the Shift.
In that case, we got a VK_CONTROL sys key up with a clear GetKeyState(VK_MENU).

It's rare case though. Usually user would do Alt+Shift. And richedit does change
to RTL when user do a RightShift+RightAlt.

Powered by Google App Engine
This is Rietveld 408576698