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

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

Issue 2025943003: MacViews: Treat Ctrl+LeftClick as RightClick on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160520-Enums-MakeThemInt-HeaderChanges-ROLLUP
Patch Set: ugh depends patchset Created 4 years, 7 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 | « no previous file | ui/events/cocoa/events_mac_unittest.mm » ('j') | ui/events/cocoa/events_mac_unittest.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/cocoa/cocoa_event_utils.mm
diff --git a/ui/events/cocoa/cocoa_event_utils.mm b/ui/events/cocoa/cocoa_event_utils.mm
index ea1bd550d96f16db1349bb5b208a0c4c8a2307f3..0615537d208a625344f590669d79cb71cdd358a3 100644
--- a/ui/events/cocoa/cocoa_event_utils.mm
+++ b/ui/events/cocoa/cocoa_event_utils.mm
@@ -46,7 +46,11 @@ int EventFlagsFromModifiers(NSUInteger modifiers) {
int EventFlagsFromNSEventWithModifiers(NSEvent* event, NSUInteger modifiers) {
int flags = EventFlagsFromModifiers(modifiers);
- flags |= IsLeftButtonEvent(event) ? ui::EF_LEFT_MOUSE_BUTTON : 0;
+ if (IsLeftButtonEvent(event)) {
+ flags |= (modifiers & NSControlKeyMask) ? ui::EF_RIGHT_MOUSE_BUTTON
+ : ui::EF_LEFT_MOUSE_BUTTON;
+ }
+
flags |= IsRightButtonEvent(event) ? ui::EF_RIGHT_MOUSE_BUTTON : 0;
flags |= IsMiddleButtonEvent(event) ? ui::EF_MIDDLE_MOUSE_BUTTON : 0;
return flags;
« no previous file with comments | « no previous file | ui/events/cocoa/events_mac_unittest.mm » ('j') | ui/events/cocoa/events_mac_unittest.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698