Fixed bug 1166 (No mouse motion events while SDL_SetRelativeMouseMode() is active and holding the mouse button)
authorSam Lantinga <slouken@libsdl.org>
Fri, 11 Mar 2011 16:03:23 -0800
changeset 5477 50cd1fb880e5
parent 5476 fb1faf6c690f
child 5478 6b65ff3cee62
Fixed bug 1166 (No mouse motion events while SDL_SetRelativeMouseMode() is active and holding the mouse button)
src/video/cocoa/SDL_cocoamouse.m
--- a/src/video/cocoa/SDL_cocoamouse.m	Fri Mar 11 14:30:00 2011 -0800
+++ b/src/video/cocoa/SDL_cocoamouse.m	Fri Mar 11 16:03:23 2011 -0800
@@ -168,7 +168,11 @@
 {
     SDL_Mouse *mouse = SDL_GetMouse();
 
-    if (mouse->relative_mode && [event type] == NSMouseMoved) {
+    if (mouse->relative_mode &&
+        ([event type] == NSMouseMoved ||
+         [event type] == NSLeftMouseDragged ||
+         [event type] == NSRightMouseDragged ||
+         [event type] == NSOtherMouseDragged)) {
         float x = [event deltaX];
         float y = [event deltaY];
         SDL_SendMouseMotion(mouse->focus, 1, (int)x, (int)y);