Fixed mouse button index for additional mouse buttons
authorSam Lantinga <slouken@libsdl.org>
Thu, 20 Jan 2011 17:29:13 -0800
changeset 5060 2170edcdfbd0
parent 5059 00d1fef487c5
child 5061 9e9940eae455
Fixed mouse button index for additional mouse buttons
src/video/cocoa/SDL_cocoaevents.m
src/video/cocoa/SDL_cocoamouse.m
--- a/src/video/cocoa/SDL_cocoaevents.m	Fri Jan 21 00:25:08 2011 +0100
+++ b/src/video/cocoa/SDL_cocoaevents.m	Thu Jan 20 17:29:13 2011 -0800
@@ -201,8 +201,8 @@
         case NSLeftMouseDragged:
         case NSRightMouseDragged:
         case NSOtherMouseDragged: /* usually middle mouse dragged */
+        case NSMouseMoved:
         case NSScrollWheel:
-        case NSMouseMoved:
             Cocoa_HandleMouseEvent(_this, event);
             /* Pass through to NSApp to make sure everything stays in sync */
             [NSApp sendEvent:event];
--- a/src/video/cocoa/SDL_cocoamouse.m	Fri Jan 21 00:25:08 2011 +0100
+++ b/src/video/cocoa/SDL_cocoamouse.m	Thu Jan 20 17:29:13 2011 -0800
@@ -43,7 +43,7 @@
         case 2:
             return(SDL_BUTTON_MIDDLE); /* 2 */
     }
-    return button;
+    return button+1;
 }
 
 void