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

Unified Diff: ui/events/win/events_win.cc

Issue 1559163002: Clean up event flags a bit: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/test/events_test_utils_x11.cc ('k') | ui/events/x/events_x.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/win/events_win.cc
diff --git a/ui/events/win/events_win.cc b/ui/events/win/events_win.cc
index c1687972cc4512e3da46ebefea72c01062f8bc79..f156501694d78395f2a1be5b1c71695d7bcc76fe 100644
--- a/ui/events/win/events_win.cc
+++ b/ui/events/win/events_win.cc
@@ -108,8 +108,8 @@ int KeyStateFlagsFromNative(const base::NativeEvent& native_event) {
int flags = GetModifiersFromKeyState();
// Check key messages for the extended key flag.
- if (IsKeyEvent(native_event))
- flags |= (HIWORD(native_event.lParam) & KF_EXTENDED) ? EF_EXTENDED : 0;
+ if (IsKeyEvent(native_event) && (HIWORD(native_event.lParam) & KF_EXTENDED))
+ flags |= EF_IS_EXTENDED_KEY;
// Most client mouse messages include key state information.
if (IsClientMouseEvent(native_event)) {
@@ -365,16 +365,16 @@ int GetModifiersFromKeyState() {
modifiers |= EF_CONTROL_DOWN;
if (ui::win::IsAltPressed())
modifiers |= EF_ALT_DOWN;
- if (ui::win::IsAltGrPressed())
- modifiers |= EF_ALTGR_DOWN;
if (ui::win::IsWindowsKeyPressed())
modifiers |= EF_COMMAND_DOWN;
- if (ui::win::IsCapsLockOn())
- modifiers |= EF_CAPS_LOCK_DOWN;
+ if (ui::win::IsAltGrPressed())
+ modifiers |= EF_ALTGR_DOWN;
if (ui::win::IsNumLockOn())
- modifiers |= EF_NUM_LOCK_DOWN;
+ modifiers |= EF_NUM_LOCK_ON;
+ if (ui::win::IsCapsLockOn())
+ modifiers |= EF_CAPS_LOCK_ON;
if (ui::win::IsScrollLockOn())
- modifiers |= EF_SCROLL_LOCK_DOWN;
+ modifiers |= EF_SCROLL_LOCK_ON;
return modifiers;
}
« no previous file with comments | « ui/events/test/events_test_utils_x11.cc ('k') | ui/events/x/events_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698