After getting a new mouse and plugging it in, the mouse pointer sensitivity was way too high for my liking. The settings for this are conveniently collected and modifiable with a tool named xinput
. Here is a short summary of my usage for this purpose.
Installation
sudo aptitude install xinput
Using the tool
Usage should be quite clear after reading man xinput
. All settings have human-readable names, and the terms used should be familiar or at least somewhat descriptive. Relevant settings in this case are explained in more detail later.
Listing devices
$ xinput --list --short
This produces a list of the devices registered, with their human-readable and internal device numbers side by side. In my case:
$ xinput --list --short
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Microsoft Comfort Mouse 6000 id=9 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ CHICONY HP Basic USB Keyboard id=8 [slave keyboard (3)]
where I see the name of my new mouse as Microsoft Comfort Mouse 6000
with corresponding ID 9
. From now on I can for xinput
purposes target this device by either the name string or its ID.
Listing device properties
$ xinput --list-props "Microsoft Comfort Mouse 6000"
Device 'Microsoft Comfort Mouse 6000':
Device Enabled (143): 1
Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (270): 0
Device Accel Constant Deceleration (271): 1.000000
Device Accel Adaptive Deceleration (272): 1.000000
Device Accel Velocity Scaling (273): 10.000000
Device Product ID (261): 1118, 1917
Device Node (262): "/dev/input/event0"
Evdev Axis Inversion (274): 0, 0
Evdev Axes Swap (276): 0
Axis Labels (277): "Rel X" (153), "Rel Y" (154), "Rel Horiz Wheel" (267), "Rel Dial" (268), "Rel Vert Wheel" (269), "Rel Misc" (581)
Button Labels (278): "Button Left" (146), "Button Middle" (147), "Button Right" (148), "Button Wheel Up" (149), "Button Wheel Down" (150), "Button Horiz Wheel Left" (151), "Button Horiz Wheel Right" (152), "Button Side" (265), "Button Extra" (266), "Button Unknown" (264), "Button Unknown" (264), "Button Unknown" (264), "Button Unknown" (264)
Evdev Middle Button Emulation (279): 0
Evdev Middle Button Timeout (280): 50
Evdev Third Button Emulation (281): 0
Evdev Third Button Emulation Timeout (282): 1000
Evdev Third Button Emulation Button (283): 3
Evdev Third Button Emulation Threshold (284): 20
Evdev Wheel Emulation (285): 0
Evdev Wheel Emulation Axes (286): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (287): 10
Evdev Wheel Emulation Timeout (288): 200
Evdev Wheel Emulation Button (289): 4
Evdev Drag Lock Buttons (290): 0
These were my default settings. The properties are listed by human-readable name and a property ID within parenthesis. Either denomination is fine to use to refer to the property.
The ones that got my attention were the ones with prefix Device Accel
. A short description of the settings follow, referenced by the X.org wiki:
Device Accel Velocity Scaling
is not a "sensitivity" setting per se, but it is related. Different mice polls the surface a different amount of times per second. This value is a compensating factor for these differences, and is therefore a device dependent setting that has a "correct" setting per mouse. To get your correct value, take the reciprocal of your mouse's update frequency and multiply by 1000. An example to clarify: my mouse has a refresh rate of 8000 Hz (found in e.g. data sheet). Thus myDevice Accel Velocity Scaling
should be 1000/8000, which gives 0.125. The default value is 10, which corresponds to a 100 Hz refresh rate. The refresh rate on available mice vary in more or less that range: 100 Hz to 8000 Hz.If this value is not known, all is not lost. If one justs wants a constant deceleration, an incorrect value here won't be a problem. If one wants to use adaptive mouse deceleration as described below, though, it might be a problem. But if it is not known, one can still experiment until it "feels right", since this is the only meaningful measure in practice.
Device Accel Constant Deceleration
is the one closest to "sensitivity". It defines a factor with which one wants to slow the pointer down. A higher value will thus slow it down more; e.g.2
will halve the pointer speed. Try setting it to10
to see exactly what it does if it is unclear.Device Accel Adaptive Deceleration
is a related setting, but it is not a constant scaling factor. Instead it depends on the movement velocity. Setting this to a high value will make the pointer scale its velocity down by that factor when moved slowly! The easiest way to demonstrate this should be to set both the above setting and this one to10
and see what happens when you move the mouse slowly. What is "slowly" in this context? Well, it depends on the earlier mentionedDevice Accel Velocity Scaling
. There is room to experiment for personal preference.
A note: don't change the first two described settings simultaneously since they are intertwined in mouse movement calculations. Begin with setting the first property value after preferably a known refresh rate as described, and then work with the latter two. If you feel you can't find a good combination of these two settings, you can try changing Device Accel Velocity Scaling
and then again try changing the two other ones, but changing the setting during calibration will just make the process unclear.
Changing device properties
$ xinput --set-prop "Microsoft Comfort Mouse 6000" "Device Accel Velocity Scaling" 0.125
Note that this is in my case is equivalent to
$ xinput --set-prop 9 273 0.125
which is less typing, but I use the long form for clarity in presentation.
Changes are applied instantly, so it's easy to experiment with different values and settings.
Result
The result is a mouse pointer that behaves the way I like. My final settings were
$ xinput --list-props "Microsoft Comfort Mouse 6000"
Device 'Microsoft Comfort Mouse 6000':
Device Enabled (143): 1
Coordinate Transformation Matrix (145): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (270): 0
Device Accel Constant Deceleration (271): 1.000000
Device Accel Adaptive Deceleration (272): 1.500000
Device Accel Velocity Scaling (273): 0.125000
Device Product ID (261): 1118, 1917
Device Node (262): "/dev/input/event0"
Evdev Axis Inversion (274): 0, 0
Evdev Axes Swap (276): 0
Axis Labels (277): "Rel X" (153), "Rel Y" (154), "Rel Horiz Wheel" (267), "Rel Dial" (268), "Rel Vert Wheel" (269), "Rel Misc" (581)
Button Labels (278): "Button Left" (146), "Button Middle" (147), "Button Right" (148), "Button Wheel Up" (149), "Button Wheel Down" (150), "Button Horiz Wheel Left" (151), "Button Horiz Wheel Right" (152), "Button Side" (265), "Button Extra" (266), "Button Unknown" (264), "Button Unknown" (264), "Button Unknown" (264), "Button Unknown" (264)
Evdev Middle Button Emulation (279): 0
Evdev Middle Button Timeout (280): 50
Evdev Third Button Emulation (281): 0
Evdev Third Button Emulation Timeout (282): 1000
Evdev Third Button Emulation Button (283): 3
Evdev Third Button Emulation Threshold (284): 20
Evdev Wheel Emulation (285): 0
Evdev Wheel Emulation Axes (286): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (287): 10
Evdev Wheel Emulation Timeout (288): 200
Evdev Wheel Emulation Button (289): 4
Evdev Drag Lock Buttons (290): 0
Happy mousing.