The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_WarpMouseInWindow not generating mousemove event on maco
jeroen.clarysse


Joined: 22 Feb 2010
Posts: 69
basically, SDL_WarpMouseInWindow() is a wrapper around mouse->WarpMouse(), and on mac, this is a pointer to Cocoa_WarpMouse()

inside Cocoa_WarpMouse, we simply have a call to CGWarpMouseCursorPosition(), which says in the header file CGRemoteOperation.h on line 223 :

/* Move the mouse cursor to the desired position in global display
coordinates without generating events. */


and indeed : if I call in SDL_WarpMouseInWindow() my application, and continuously display the coordinates received by SDL_GetMouseState() , the coordinates DO NOT CHANGE

what is the best way to solve this ? Is there a way to force a mousemove event from my application without “patching” SDL ?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL_WarpMouseInWindow not generating mousemove event on maco
jeroen.clarysse


Joined: 22 Feb 2010
Posts: 69
replying to myself… it seems that I somehow use a slightly older version of SDL2 ! I will try to upgrade all my dependencies and see if this fixed the issue



Quote:
basically, SDL_WarpMouseInWindow() is a wrapper around mouse->WarpMouse(), and on mac, this is a pointer to Cocoa_WarpMouse()

inside Cocoa_WarpMouse, we simply have a call to CGWarpMouseCursorPosition(), which says in the header file CGRemoteOperation.h on line 223 :

/* Move the mouse cursor to the desired position in global display
coordinates without generating events. */


and indeed : if I call in SDL_WarpMouseInWindow() my application, and continuously display the coordinates received by SDL_GetMouseState() , the coordinates DO NOT CHANGE

what is the best way to solve this ? Is there a way to force a mousemove event from my application without “patching” SDL ?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org