Talk:Mouse acceleration

From ArchWiki
Latest comment: 5 August 2023 by Quodroc in topic Libinput custom acceleration profile

Reworking the article

This article seems to be a mess, but I don't exactly know where to start, especially since this may quickly turn into a general mouse configuration article. However, here are some notes:

  • Arch currently seems to put its X config files in /usr/share/X11/xorg.conf.d/, rather than /etc/X11/xorg.conf.d/.
  • Arch seems to use libinput by default now (can't say this for sure, might just be my LXQt setup).

Here is some stuff that I was considering to add but held back for the reason stated above; feedback is appreciated:

Distinguishing between multiple pointer devices

If you have multiple pointer devices connected, but you want to configure them separately, you may distinguish between them by their vendor and product name.

First, list the xinput devices:

$ xinput --list

Note down the name (e.g. 'Logitech USB Optical Mouse'). This name has to be split into a vendor and a product string. It seems that the first space always acts as a separator, regardless of what appears to make more sense.

Now, apart from MatchIsPointer, add MatchVendor and MatchProduct to the section of your pointer device:

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass"
	Identifier "Logitech Mouse 1000dpi"
	MatchVendor "Logitech"
	MatchProduct "USB Optical Mouse"
	Driver "libinput"
	MatchIsPointer "yes"
	Option "AccelProfile" "flat"
	Option "AccelSpeed" "-0.6"
EndSection

Restart X and make sure that the settings are still applied correctly.

Matching speed of different mice (libinput)

When you are switching mice, you may want to ease the transition by having them move the pointer at the same speed, regardless of their DPI settings.

In this example, a Logitech mouse with a sensitivity of 1000 DPI is used along with ZOWIE gaming mouse with a sensitivity of 400 DPI. This means that in order to match the ZOWIE mouse, the Logitech mouse has to move 40% slower (keep in mind that an acceleration greater than 0 may lead to pixels being skipped):

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass"
	Identifier "Logitech Mouse 1000dpi"
	MatchVendor "Logitech"
	MatchProduct "USB Optical Mouse"
	Driver "libinput"
	MatchIsPointer "yes"
	Option "AccelProfile" "flat"
	Option "AccelSpeed" "-0.6"
EndSection

Section "InputClass"
        Identifier "Zowie Mouse 400dpi"
        MatchVendor "Kingsis"
        MatchProduct "Peripherals ZOWIE Gaming mouse"
        Driver "libinput"
        MatchIsPointer "yes"
        Option "AccelProfile" "flat"
        Option "AccelSpeed" "0.0"
EndSection

--Krukai (talk) 00:30, 7 February 2017 (UTC)Reply[reply]

Hi, yes a different section structure would help to condense the article. Regarding your questions: A crosslink to Xorg#Input devices should clarify directory paths. The default to libinput is general now yes, but only recently (Xorg#Input devices).
Regarding your above example. The first conf file seems a natural extension of how Mouse_acceleration#In Xorg configuration ends (matching the mouse exactly while you give another example of relevant Options at the same time). I think it could be merged in there. The second section you propose with two configs does not seem necessary to me. A sentence stating that exact matching enables to have different settings per device should be enough. --Indigo (talk) 10:29, 9 February 2017 (UTC)Reply[reply]
Yes, and the article definitely needs to contain an example of AccelProfile "flat" + AccelSpeed as an analogue of AccelerationProfile "-1" + ConstantDeceleration in evdev. --AleXoundOS (talk) 20:21, 8 October 2017 (UTC)Reply[reply]

Outdated xinput options

There is no such thing like "Device Accel Constant Deceleration" nowadays. —This unsigned comment is by Andrej (talk) 23:23, 16 April 2019 (UTC). Please sign your posts with ~~~~!Reply[reply]

You might want to look at the script I use to configure my input devices: https://github.com/denilsonsa/small_scripts/blob/master/xinput_configure_all_my_devices.py Denilsonsa (talk) 07:59, 18 April 2019 (UTC)Reply[reply]

ConstantDeceleration

Hello, I believe that this could be expanded with an explanation of different drivers (such as evdev) and differences between the curves. Xorg Documentation shows that there are seven types of mouse acceleration. None, Device-dependent, polynomial, smooth linear, simple, power, linear, and limited. Some of these are visually graphed here. - although it seems some types may have been replaced/removed since the creation of that article. Also, Constant Deceleration does exist, you can edit it in your xorg config. Here's mine:

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass"
         Identifier "Glorious Model O"
         MatchIsPointer "Yes"
         Driver "evdev"
         Option "AccelerationScheme" "predictable"
         Option "AccelerationProfile" "6"
         Option "ConstantDeceleration" "1"
         Option "AdaptiveDeceleration" "1"
         Option "VelocityScale" "1"
         Option "AccelerationNumerator" "13"
         Option "AccelerationDenominator" "100"
         Option "AccelerationThreshold" "1"
EndSection

AverytheFurry (talk) 22:37, 9 March 2021 (UTC)Reply[reply]

Libinput custom acceleration profile

Libinput 1.23 added support for a custom acceleration profile. It would be nice to have an example config for it.

More info:

https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#ptraccel-profile-custom

https://who-t.blogspot.com/2023/01/libinput-and-custom-pointer.html

https://www.phoronix.com/news/libinput-1.23-Released

Quodroc (talk) 18:45, 10 May 2023 (UTC)Reply[reply]

I recently set up a libinput custom profile for a trackball mouse, that needs precise movement at low speeds, but very fast acceleration at high speeds.

This is what I am currently using:

xinput --set-prop 'pointer:ELECOM ELECOM TrackBall Mouse' 'libinput Accel Profile Enabled' 0 0 1
xinput --set-prop 'pointer:ELECOM ELECOM TrackBall Mouse' 'libinput Accel Custom Motion Step' 1.0
xinput --set-prop 'pointer:ELECOM ELECOM TrackBall Mouse' 'libinput Accel Custom Motion Points' 0.0 0.5 1.9 4.0 10.0

If I understand the above docs correctly, these Custom Motion Points mean:

Mouse speed Pointer speed on screen
0 0.0
1 0.5
2 1.9
3 4.0
4 10.0

--SectionEight (talk) 12:21, 17 July 2023 (UTC)Reply[reply]

Here is my attempt at simulating Windows mouse acceleration with "Enhance Pointer Precision"

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf
Section "InputClass"
  Identifier "Custom Mouse Acceleration"
  MatchDriver "libinput"
  MatchIsPointer "yes"
  MatchProduct "Mouse"
  Option "AccelProfile" "custom"
  Option "AccelStepMotion" "0.5"
  Option "AccelPointsMotion" "0.0 0.25 0.75 1.5 2.5"
EndSection

Quodroc (talk) 22:04, 5 August 2023 (UTC)Reply[reply]