Disabling mouse acceleration in Mac OS X [closed]

Solution 1:

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.