src/video/cocoa/SDL_cocoawindow.m
changeset 7740 415bb39617a1
parent 7636 d5167d0818b3
child 7746 6a05d7352575
--- a/src/video/cocoa/SDL_cocoawindow.m	Fri Sep 13 17:41:17 2013 -0700
+++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Sep 13 17:42:31 2013 -0700
@@ -62,6 +62,7 @@
 
     _data = data;
     observingVisible = YES;
+    wasCtrlLeft = NO;
     wasVisible = [window isVisible];
 
     center = [NSNotificationCenter defaultCenter];
@@ -333,7 +334,13 @@
 
     switch ([theEvent buttonNumber]) {
     case 0:
-        button = SDL_BUTTON_LEFT;
+        if ([theEvent modifierFlags] & NSControlKeyMask) {
+            wasCtrlLeft = YES;
+            button = SDL_BUTTON_RIGHT;
+        } else {
+            wasCtrlLeft = NO;
+            button = SDL_BUTTON_LEFT;
+        }
         break;
     case 1:
         button = SDL_BUTTON_RIGHT;
@@ -364,7 +371,12 @@
 
     switch ([theEvent buttonNumber]) {
     case 0:
-        button = SDL_BUTTON_LEFT;
+        if (wasCtrlLeft) {
+            button = SDL_BUTTON_RIGHT;
+            wasCtrlLeft = NO;
+        } else {
+            button = SDL_BUTTON_LEFT;
+        }
         break;
     case 1:
         button = SDL_BUTTON_RIGHT;