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_WarpMouse breaks mouse movement on Mac
Oogst


Joined: 09 Aug 2012
Posts: 12
We have encountered an issue in SDL 1.2.15 on Mac where if you use the SDL_WarpMouse function less mousemoved events happen. When commenting out the platform specific function "CGWarpMouseCursorPosition" the number of mouse events increases again. It looks like by calling this function apple drops some of the mouse events, this is just guessing on my end thought. Hopefully somebody on these forums knows a little more about the macos' SDK!
brada


Joined: 16 Aug 2012
Posts: 38
should be an easy fix involving CGSetLocalEventsSuppressionInterval

unfortunately it is labeled as deprecated with no listed replacement.

Edit: i lied. its replacement is CGEventSourceSetLocalEventsSuppressionInterval
SDL_WarpMouse breaks mouse movement on Mac
Sik


Joined: 26 Nov 2011
Posts: 905
From that link:

"This function is not recommended for general use because of
undocumented special cases and undesirable side effects. The
recommended replacement for this function is
CGEventSourceSetLocalEventsSuppressionInterval, which allows the
suppression interval to be adjusted for a specific event source,
affecting only events posted using that event source."

2012/11/29 brada:
Quote:
should be an easy fix involving CGSetLocalEventsSuppressionInterval

unfortunately it is labeled as deprecated with no listed replacement.

_______________________________________________
SDL mailing list

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

_______________________________________________
SDL mailing list

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


Joined: 16 Aug 2012
Posts: 38
yes. i had already edited my response to include that.
Oogst


Joined: 09 Aug 2012
Posts: 12
Thank you for your replies! Unfortunately this did not solve our problems, also when looking up the "CGEventSourceSetLocalEventsSuppressionInterval" function we encountered the following:

http://lists.libsdl.org/pipermail/commits-libsdl.org/2012-January/005292.html

Looks like this function is patched out earlier this year in favour of the CGAssociateMouseAndMouseCursorPosition calls. We tried both solutions and none worked. Both produced a very stuttering cursor!

Thanks again for the replies, for now we have solved the problem by not enabling mouse sensitivity on the Mac version of our game.
brada


Joined: 16 Aug 2012
Posts: 38
I have no similar problems using these APIs, but i dont use them with SDL. maybe you should post some code.