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
OSX: Relative mousemode is accelerated, should be raw(?)
Daniel Gibson
Guest

Hi,

I recently tried playing a FPS game using SDL2 on OSX, using a normal
mouse, and it was pretty bad: Aiming was almost impossible because the
mouse input is accelerated. (The common workaround currently seems to be
using thirdparty tools like to disable mouse acceleration system-wide.)
On Windows and Linux you get raw mouse input in relative mode, which
IMHO is the right thing to do - however "slime" of #SDL argued that when
using a trackpad, accelerated mouse input is preferable even in relative
mode.
Note however that the current behavior is inconsistent with Windows and
Linux and if raw mouse input on OSX were implemented, one could still
use SDL_HINT_MOUSE_RELATIVE_MODE_WARP to get the old/current behavior.

I found http://forums.libsdl.org/viewtopic.php?t=9969 which describes a
way to get raw mouse input on OSX, does anyone know why SDL2 doesn't do
that? Does the approach have any problems or was it just not implemented
because no one got around to do it?

There's also a really old bugreport:
https://bugzilla.libsdl.org/show_bug.cgi?id=445

Any thoughts on the topic? :-)

Cheers,
Daniel
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
OSX: Relative mousemode is accelerated, should be raw(?)
eric.w


Joined: 12 Feb 2014
Posts: 38
Hi,
I agree completely, OS X relative mode should match Linux and Windows and give raw input.

A way to opt-in to acceleration would be nice as well, but I think that would be a separate new feature.

I sent a patch to the list a while ago with a first stab at implementing this:
http://lists.libsdl.org/pipermail/sdl-libsdl.org/2014-October/096672.html


Haven't looked at the patch since 2014. Maybe I should have filed it in the bug tracker, oops.

Anyway, if there is interest I could try resurrecting and cleaning up this patch.

Cheers,
Eric


On Sun, Mar 13, 2016 at 5:35 PM, Daniel Gibson wrote:
Quote:
Hi,

I recently tried playing a FPS game using SDL2 on OSX, using a normal mouse, and it was pretty bad: Aiming was almost impossible because the mouse input is accelerated. (The common workaround currently seems to be using thirdparty tools like to disable mouse acceleration system-wide.)
On Windows and Linux you get raw mouse input in relative mode, which IMHO is the right thing to do - however "slime" of #SDL argued that when using a trackpad, accelerated mouse input is preferable even in relative mode.
Note however that the current behavior is inconsistent with Windows and Linux and if raw mouse input on OSX were implemented, one could still use SDL_HINT_MOUSE_RELATIVE_MODE_WARP to get the old/current behavior.

I found http://forums.libsdl.org/viewtopic.php?t=9969 which describes a way to get raw mouse input on OSX, does anyone know why SDL2 doesn't do that? Does the approach have any problems or was it just not implemented because no one got around to do it?

There's also a really old bugreport: https://bugzilla.libsdl.org/show_bug.cgi?id=445

Any thoughts on the topic? :-)

Cheers,
Daniel
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
OSX: Relative mousemode is accelerated, should be raw(?)
Daniel Gibson
Guest

Oh cool, totally missed that patch!

Do you think there is a way to get raw input without spending 15% of the
CPU time in the raw mouse thread? It sounds a lot (even if it might be
tolerable if there is no other way).

Cheers,
Daniel

On 03/14/2016 06:01 AM, Eric Wasylishen wrote:
Quote:
Hi,
I agree completely, OS X relative mode should match Linux and Windows
and give raw input.
A way to opt-in to acceleration would be nice as well, but I think that
would be a separate new feature.

I sent a patch to the list a while ago with a first stab at implementing
this:
http://lists.libsdl.org/pipermail/sdl-libsdl.org/2014-October/096672.html

Haven't looked at the patch since 2014. Maybe I should have filed it in
the bug tracker, oops.
Anyway, if there is interest I could try resurrecting and cleaning up
this patch.
Cheers,
Eric

On Sun, Mar 13, 2016 at 5:35 PM, Daniel Gibson
<mailto:> wrote:

Hi,

I recently tried playing a FPS game using SDL2 on OSX, using a
normal mouse, and it was pretty bad: Aiming was almost impossible
because the mouse input is accelerated. (The common workaround
currently seems to be using thirdparty tools like to disable mouse
acceleration system-wide.)
On Windows and Linux you get raw mouse input in relative mode, which
IMHO is the right thing to do - however "slime" of #SDL argued that
when using a trackpad, accelerated mouse input is preferable even in
relative mode.
Note however that the current behavior is inconsistent with Windows
and Linux and if raw mouse input on OSX were implemented, one could
still use SDL_HINT_MOUSE_RELATIVE_MODE_WARP to get the old/current
behavior.

I found http://forums.libsdl.org/viewtopic.php?t=9969 which
describes a way to get raw mouse input on OSX, does anyone know why
SDL2 doesn't do that? Does the approach have any problems or was it
just not implemented because no one got around to do it?

There's also a really old bugreport:
https://bugzilla.libsdl.org/show_bug.cgi?id=445

Any thoughts on the topic? :-)

Cheers,
Daniel
_______________________________________________
SDL mailing list
<mailto:
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



_______________________________________________
SDL mailing list

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


Joined: 13 Apr 2016
Posts: 3
Actually I just stumbled upon a related bug (about raw events not working properly) when I just upgraded my game to SDL 2.0.4.

On my Macbook with OSX El Capitan (10.11), SDL_SetRelativeMouseMode(SDL_TRUE) breaks the SDL_MOUSEMOTION events completely, you don't get any events - neither with the trackpad nor with a real USB mouse. Mousebutton events and keyboard events work fine.

Setting the additional SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1") makes it work, but has the side-effect that if you jitter the mouse around a bit, OSX pop ups a mega-large mousepointer for a few seconds which SDL doesn't seem to know how to hide. I guess as some kind of sight-impaired help..

Anyway, my interpretation is that the relative mouse mode seems to be broken on OSX 10.11 and SDL 2.0.4 as far as I can tell, when it tries to use raw events (which it should try without the hint set).

On Linux, the same code works fine with SDL 2.0.4 and SetRelativeMouseMode. Haven't tried on Windows yet.
bjornw2


Joined: 13 Apr 2016
Posts: 3
FYI tested the same code also on Windows (with 2.0.4 as shipped from libsdl.org) and it worked fine there as well. It's only on the Mac it's broken.

bjornw2 wrote:
Actually I just stumbled upon a related bug (about raw events not working properly) when I just upgraded my game to SDL 2.0.4.

On my Macbook with OSX El Capitan (10.11), SDL_SetRelativeMouseMode(SDL_TRUE) breaks the SDL_MOUSEMOTION events completely, you don't get any events - neither with the trackpad nor with a real USB mouse. Mousebutton events and keyboard events work fine.

Setting the additional SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1") makes it work, but has the side-effect that if you jitter the mouse around a bit, OSX pop ups a mega-large mousepointer for a few seconds which SDL doesn't seem to know how to hide. I guess as some kind of sight-impaired help..

Anyway, my interpretation is that the relative mouse mode seems to be broken on OSX 10.11 and SDL 2.0.4 as far as I can tell, when it tries to use raw events (which it should try without the hint set).

On Linux, the same code works fine with SDL 2.0.4 and SetRelativeMouseMode. Haven't tried on Windows yet.
bjornw2


Joined: 13 Apr 2016
Posts: 3
As a reference in case anyone finds this, see https://bugzilla.libsdl.org/show_bug.cgi?id=3312 (was a problem in the 2.0.4 release, didn't check if it was solved in the latest snapshot though)

bjornw2 wrote:
FYI tested the same code also on Windows (with 2.0.4 as shipped from libsdl.org) and it worked fine there as well. It's only on the Mac it's broken.

bjornw2 wrote:
Actually I just stumbled upon a related bug (about raw events not working properly) when I just upgraded my game to SDL 2.0.4.

On my Macbook with OSX El Capitan (10.11), SDL_SetRelativeMouseMode(SDL_TRUE) breaks the SDL_MOUSEMOTION events completely, you don't get any events - neither with the trackpad nor with a real USB mouse. Mousebutton events and keyboard events work fine.

Setting the additional SDL_SetHint(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1") makes it work, but has the side-effect that if you jitter the mouse around a bit, OSX pop ups a mega-large mousepointer for a few seconds which SDL doesn't seem to know how to hide. I guess as some kind of sight-impaired help..

Anyway, my interpretation is that the relative mouse mode seems to be broken on OSX 10.11 and SDL 2.0.4 as far as I can tell, when it tries to use raw events (which it should try without the hint set).

On Linux, the same code works fine with SDL 2.0.4 and SetRelativeMouseMode. Haven't tried on Windows yet.
eric.w


Joined: 12 Feb 2014
Posts: 38
Thanks for pointing this out - I posted another fix on the bugzilla page: https://bugzilla.libsdl.org/show_bug.cgi?id=3312