61

First of all, here's the userland question: Disabling mouse acceleration in Mac OS X @ superuser

To summarize: I want to have linear mouse response on Mac OS X. That is, no acceleration; an adjustable but constant pixels pointer moves / meters mouse moved ratio.

I have no idea how to go about this. (Well, not true, but it's better to start from scratch.) Should I write a mouse driver? A startup program? A click-and-forget settings adjuster? A preferences pane?

I want my solution to be as simple, universal and unintrusive as possible, so some criteria might be:

  • Works on Snow Leopard (10.6.5) and later - much later, unless an important piece of the API gets deprecated
  • Works on mice but not touchpads, tablets, magic wands... (Or maybe configurable?)
  • Can easily be applied/run by other people who want the same thing (all 42 of us on the planet)

I'm a fairly experienced C programmer, both in user and kernel space (in Linux and Windows), but know next to nothing about Mac OS X or Darwin. So anything is appreciated, really ("can't distribute drivers without certificate from Apple") but some documentation/reference would get me a long way ("Darwin's Next Generation Mouse Curve Editing API and Examples").

I know the question is a bit open but I don't even know what kind of a solution could work. Thanks in advance.

Edit: Although I've asked both questions to solve the same problem, this is the programmatical counterpart to the other one. (See the first sentence of this question.) Here I'm trying to create my own solution, so to speak, using - I don't know - some HID API? A driver? A solution on the lines of "open current user's prefs file and change this setting to this" should probably be posted on the other question, but note that such a solution probably doesn't exist.

Community
  • 1
  • 1
aib
  • 45,516
  • 10
  • 73
  • 79
  • I suppose what you really want is to make cursor feel the same as in Windows with acceleration off. In that case, the problem is bigger than just acceleration. Check http://d43.me/blog/1205/the-cause-for-all-your-mac-os-x-mouse-annoyances/ – hamstergene May 21 '12 at 13:26
  • To bring it back on topic, I've just found this: http://forums3.armagetronad.net/viewtopic.php?t=3364 – Beetle May 12 '13 at 13:56
  • 2
    http://smoothmouse.com/ seems to be the solution. It works great on my MacBook Air running Mavericks. – carlodef Jan 22 '14 at 13:37
  • @lorenzo Bless you! If you'll add that as an answer to http://superuser.com/questions/218314/, I'll upvote it. – Johann Nov 11 '14 at 02:04
  • @Johann Thank you! I added that as an answer on superuser – carlodef Nov 11 '14 at 08:40
  • For those interested I found my solution here, as noted in the above comment - use smoothmouse: http://apple.stackexchange.com/questions/251456/how-to-disable-mouse-acceleration-in-os-x-el-capitan-while-allowing-mouse-pointe/251457#251457 – FreelanceConsultant Sep 05 '16 at 19:04
  • Voting to reopen: as currently phrased, this question about APIs is appropriate for stackoverflow (and I would love to post the answer about the relevant IOKit `HIDMouseAcceleration` APIs). – p00ya Jun 30 '21 at 05:58

1 Answers1

77

This answer is on the wrong website!

A lot of my reputation on StackOverflow has come from people voting up this answer, which I wrote way back before I realised that there are several stack exchange websites and that StackOverflow is for programming questions and answers only. Therefore the question above is about how to tackle this if you want to code your own mouse drivers. For all other discussion, go have it here on the superuser site where it belongs.

Original answer follows.


Explanation

There's a hidden preference that you can change from the Terminal. To read its current value type

defaults read .GlobalPreferences com.apple.mouse.scaling

at the Terminal prompt. Normal values are 0 ~ 3, which can be set by moving the 'Tracking Speed' slider in the Mouse pane of System Preferences. Values of 0 ~ 3 won't disable acceleration, therefore.

How to Disable Acceleration

However, if you set it to -1 by typing

defaults write .GlobalPreferences com.apple.mouse.scaling -1

in the Terminal, that seems to disable acceleration and set the mouse tracking speed to some constant predefined value which you can't change.

I found I had to log out and back in again for it to take effect. After that, the pixels pointer moves / meters mouse moved ratio is constant but unfortunately not adjustable.

How to Undo Changes

To revert back to Apple default settings, just open the Mouse pane of System Preferences and change the Tracking Speed to anything, then quit System Preferences.

Mouse ≠ Trackpad

Mac OS X stores mouse and trackpad settings independently. If you want to disable acceleration on a trackpad instead of a mouse, the instructions are the same, just replace with com.apple.trackpad.scaling wherever you see com.apple.mouse.scaling in the above (and use the Trackpad pane of System Preferences instead of the Mouse pane, obviously).

Notes

I won't cite a source, since this tip is available in many places on the web. I tried it in OS 10.7 Lion, but many of the sources claim to be using 10.6 Snow Leopard.

Community
  • 1
  • 1
Beetle
  • 1,959
  • 16
  • 32
  • 2
    You could try [CursorSense](http://plentycom.jp/en/cursorsense/) or the suggestions at [superuser](http://superuser.com/questions/218314/disabling-mouse-acceleration-in-mac-os-x) – Beetle May 25 '13 at 10:41
  • Thanks again for the tip, I have actually become quite used to the fast (but consistent) movement speed. So much better than the default! – Lea Hayes Jun 16 '13 at 18:26
  • 3
    This doesn't seem to work on Mavericks -- I'm getting `The domain/default pair [...] does not exist` – remram Dec 16 '13 at 15:09
  • 4
    @remram Try `defaults write -g com.apple.mouse.scaling -1` – Beetle Dec 31 '13 at 10:55
  • Is there a way to increase the mouse speed while keeping the scaling at -1? – Claus Jørgensen Nov 13 '14 at 08:29
  • @ClausJørgensen: There are some apps that do that, but stackoverflow is the wrong site for this (I didn't realise when I wrote the answer, because I was new here) which is why the question was closed. Ask at [superuser.com/questions/218314/](http://superuser.com/questions/218314/) – Beetle Nov 14 '14 at 11:23
  • 2
    Also works in Yosemite. – Neurotransmitter Mar 25 '15 at 16:44
  • 2
    Also works in El Capitan – Tormod Haugene Oct 15 '15 at 11:05
  • Works but doesn't work - the speed of the mouse pointer is so slow that it's essentially unusable... – FreelanceConsultant Sep 03 '16 at 17:25
  • @user3728501 I believe the speed depends on which mouse you use. If you choose a gaming mouse with a high DPI, I believe it will go faster. For a lot less money, you can get a mouse mat if you are not using one. Almost anything will move faster on a mouse mat. You may also find the default acceleration bearable when using a mouse mat. – Beetle Sep 05 '16 at 11:10
  • @Beetle Thanks for the comment but I already have both those things. Acceleration is unbearable for me under all circumstances except when using a touchpad - obviously touchpads are impossible to use without acceleration and presumably that is where the initial inspiration for the concept of acceleration comes from. (Touchpad surface on laptops when laptops started appearing with HD screens was too small to have the accuracy required for small detail like text selection while still allowing the user to scan the mouse across the whole screen in 1 or 2 swipes.) – FreelanceConsultant Sep 05 '16 at 19:02
  • 1
    @user3728501 I feel your pain. On Sierra the only way I was able to get the right profile was by installing SteerMouse. Disabling acceleration was possible without it, but I lost sensitivity. SteerMouse gives a warning when I enter the mouse sensitivity to give the same tracking movement as my Xorg system, but you can ignore the warning. By trial and error, holding the two mice together and watching the cursor travel across two screens I was able to get the same movement. It varies from mouse to mouse, so if you use more than one mouse you may need to set this differently for each. – Keeely Apr 21 '17 at 10:26
  • I don't think this works in Catalina. I had it working, then upgraded to 10.15.5, and acceleration is back. See https://apple.stackexchange.com/questions/380552/how-to-disable-mouse-acceleration-in-catalina – jpbochi Jun 03 '20 at 09:14