I see from #121 and #242 that I am not the only person coming from Windows and trying to match the mouse acceleration curve. I will use this issue to provide some of my own research on the topic, and to plan a potential solution for this problem using LinearMouse, if you are interested!
The first important thing to highlight is that macOS and Windows use fundamentally different acceleration curves. This means that it is completely impossible to match them 1:1.
Windows
No official details are available, but according to this post, Windows uses a 5-point composite curve, like so:
In fact, the individual curves may not even be linear but exponential according to this post and its comments:
There are some very knowledgeable individuals over at RawAccel, who have developed their own Windows driver that allows custom acceleration curves at an OS level. One of their curves, the Natural Curve, is allegedly so close to the curve used by Windows, that it can be used as an effective substitute without noticing a difference. Maybe we can ask them for more details on the original curve and/or take their Natural Curve as our Windows baseline.
macOS
What about macOS? Information here is even more limited, but it apparently uses a single exponential curve, at least according to CursorSense:
The solutions
So, it is clear that we need some sort of third-party solution to make macOS match the curve of Windows. I have a few ideas, which I will list below.
Solution 1 — create a custom driver using HIDDriverKit
- Pros: By far the proper solution, would work everywhere, waste no CPU, and allow 1:1 matching of the Windows curve
- Cons: Hard to write
Solution 2 — try to "best fit" the macOS curve to Windows curve
- Pros: Easy, can be accomplished using LinearMouse
- Cons: Inaccurate, hard to pull off
I actually started some experiments on solution 2. I programmed a Raspberry Pi Pico as a virtual mouse, and I wrote some scripts that will make the mouse move across the screen at different speeds, and then write down how much "physical movement" equals how much "actual movement". Then, I plot this and I get an accurate acceleration graph of both macOS and Windows. I need to run it for longer to get anything meaningful, but will post here once I do.
Well, this is my research so far. If anybody has further ideas, suggestions, or wants to help, please feel more than welcome to do so!
help wanted