| Summary: | SDL Mouse acceleration fix for OS X | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Zachary J. Slater <zakk> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | API change | ||
| Priority: | P2 | CC: | amaranth72, ewasylishen |
| Version: | HG 2.1 | ||
| Hardware: | x86 | ||
| OS: | Mac OS X (All) | ||
| Attachments: |
First draft of OS X raw mouse support
raw mouse patch v2 |
||
|
Description
Zachary J. Slater
2007-06-27 15:20:50 UTC
Maybe this would be better implemented with an actual mouse acceleration API? Maybe along the lines of the existing SDL 1.2 environment variable SDL_VIDEO_X11_MOUSEACCEL? you can get around it by disabling mouse acceleration using the carbon api. I'm sure it would be feasable to put this in a future release of SDL. Created attachment 2408 [details] First draft of OS X raw mouse support Resurrecting this.. SDL_SetRelativeMouseMode on Windows and Linux (afaik) gives raw non-accelerated mouse events. Would be nice to do the same on OS X, for consistency. The current OSX mouse input code is using NSEvent which are throttled to 60Hz and have acceleration applied. The fix is to use the IOHID API's instead of NSEvent. SDL already uses these API's for accessing joysticks. I wrote a draft implementation a while ago, attaching it here. I have a feeling it shouldn't use NSThread, and the CPU usage needs to be examined because I remember it being a bit high. Related mailing list posts: http://lists.libsdl.org/pipermail/sdl-libsdl.org/2014-October/096672.html https://forums.libsdl.org/viewtopic.php?t=11838 Created attachment 2466 [details]
raw mouse patch v2
New patch, rewritten from scratch.
- everything done on main thread now.
- uses IOHIDQueue API to receive raw mouse events.
I believe IOHIDManagerRegisterInputValueCallback is broken on OS X 10.6 (some events get dropped with a 500Hz mouse), and using the IOHIDQueue API works around this because we can explicitly specify the event queue size.
Tested on OS X 10.6 and 10.11.
|