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

Unified Diff: ui/events/cocoa/events_mac.mm

Issue 2439953005: Support NSFlagsChanged in ui::EventFromNative. (Closed)
Patch Set: Unify NSFlagsChanged handling between content and ui/events. Created 4 years, 2 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/cocoa/cocoa_event_utils.mm ('k') | ui/events/cocoa/events_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/cocoa/events_mac.mm
diff --git a/ui/events/cocoa/events_mac.mm b/ui/events/cocoa/events_mac.mm
index 4a8347fd25f67bb93125ef6f5ff82f407334ee13..09398f922e1bcae9f64c19eb87744bc24a1a1e21 100644
--- a/ui/events/cocoa/events_mac.mm
+++ b/ui/events/cocoa/events_mac.mm
@@ -25,9 +25,9 @@ EventType EventTypeFromNative(const base::NativeEvent& native_event) {
NSEventType type = [native_event type];
switch (type) {
case NSKeyDown:
- return ET_KEY_PRESSED;
case NSKeyUp:
- return ET_KEY_RELEASED;
+ case NSFlagsChanged:
+ return IsKeyUpEvent(native_event) ? ET_KEY_RELEASED : ET_KEY_PRESSED;
case NSLeftMouseDown:
case NSRightMouseDown:
case NSOtherMouseDown:
@@ -53,7 +53,6 @@ EventType EventTypeFromNative(const base::NativeEvent& native_event) {
case NSAppKitDefined:
case NSSystemDefined:
return ET_UNKNOWN;
- case NSFlagsChanged:
case NSApplicationDefined:
case NSPeriodic:
case NSCursorUpdate:
« no previous file with comments | « ui/events/cocoa/cocoa_event_utils.mm ('k') | ui/events/cocoa/events_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698