Fixed bug 1166 (No mouse motion events while SDL_SetRelativeMouseMode() is active and holding the mouse button)

This commit is contained in:
Sam Lantinga 2011-03-11 16:03:23 -08:00
parent 8fe03ca350
commit 06a33455ca

View file

@ -168,7 +168,11 @@ Cocoa_HandleMouseEvent(_THIS, NSEvent *event)
{
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);