You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.1 Reported for operating system, platform: Mac OS X (All), x86
Comments on the original bug report:
On 2007-06-27 15:20:50 +0000, Zachary J. Slater wrote:
With SDL and, in fact, any program under OS X you get mouse acceleration if you want it or not. This is completely bad for FPS players or anything else where quick mouse positioning is important. The logical solution seems to be to offer an environment variable so this can be fixed one way globally instead of per-game in a multitude of methods.
Please implement this in SDL 1.3 with the environment variable "SDL_FUCK_WITH_MOUSE_ACCEL"
On 2007-07-04 23:21:40 +0000, Sam Lantinga wrote:
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?
On 2007-10-03 08:33:28 +0000, Gavin wrote:
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.
On 2016-04-07 17:47:58 +0000, Eric Wasylishen wrote:
Created attachment 2408
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.
On 2016-05-26 22:54:39 +0000, Eric Wasylishen wrote:
Created attachment 2466
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.
The text was updated successfully, but these errors were encountered:
I left some comments on Discourse in 2017 from testing my patch, I believe the "raw mouse patch v2" above is the latest version of it.
It seems like on macOS 10.12, trackpads (at least my 2012 15" rMBP) no longer produce any events through the IOHIDManager API.
I guess this might be related to trackpads becoming natively touch devices (is that how it works on modern macOS?)
So the upshot was: with my patch, once inside relative mouse mode in SDL, only external USB mice generate relative motion events, not the trackpad. Hopefully it's a solvable problem.
Another question: I wonder if it's worth using libhidapi now, over IOHIDManagerRef, since SDL is already using that on macOS.
Lastly I guess we should double check if there is a new macOS API for this - afaik in 2017, last time I looked at it, IOHIDManagerRef was the best bet.
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
First draft of OS X raw mouse support (rawmouse.patch, text/plain, 2016-04-07 17:47:58 +0000, 10281 bytes)Reported in version: HG 2.1
Reported for operating system, platform: Mac OS X (All), x86
Comments on the original bug report:
On 2007-06-27 15:20:50 +0000, Zachary J. Slater wrote:
On 2007-07-04 23:21:40 +0000, Sam Lantinga wrote:
On 2007-10-03 08:33:28 +0000, Gavin wrote:
On 2016-04-07 17:47:58 +0000, Eric Wasylishen wrote:
On 2016-05-26 22:54:39 +0000, Eric Wasylishen wrote:
The text was updated successfully, but these errors were encountered: