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 547750cd1fb880e5
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
     1.1 --- a/src/video/cocoa/SDL_cocoamouse.m	Fri Mar 11 14:30:00 2011 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoamouse.m	Fri Mar 11 16:03:23 2011 -0800
     1.3 @@ -168,7 +168,11 @@
     1.4  {
     1.5      SDL_Mouse *mouse = SDL_GetMouse();
     1.6  
     1.7 -    if (mouse->relative_mode && [event type] == NSMouseMoved) {
     1.8 +    if (mouse->relative_mode &&
     1.9 +        ([event type] == NSMouseMoved ||
    1.10 +         [event type] == NSLeftMouseDragged ||
    1.11 +         [event type] == NSRightMouseDragged ||
    1.12 +         [event type] == NSOtherMouseDragged)) {
    1.13          float x = [event deltaX];
    1.14          float y = [event deltaY];
    1.15          SDL_SendMouseMotion(mouse->focus, 1, (int)x, (int)y);