Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug 1166 (No mouse motion events while SDL_SetRelativeMouseMode…
Browse files Browse the repository at this point in the history
…() is active and holding the mouse button)
  • Loading branch information
slouken committed Mar 12, 2011
1 parent b792f15 commit 80077bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/video/cocoa/SDL_cocoamouse.m
Expand Up @@ -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);
Expand Down

0 comments on commit 80077bb

Please sign in to comment.