How to change scrolling speed with xinput when there's no "scroll distance" prop?
Most other answers on this type of question point to using xinput
to set the "scroll distance" or "scroll delta" from "evdev".
But my device have zero evdev or Scroll distance properties. All i have is libinput ones, and none seem to be the correct one by the labels.
Q: how can I speed up the mouse scroll wheel on this device:
$ xinput list-props 'Logitech Trackball'
Device 'Logitech Trackball':
Device Enabled (203): 1
Coordinate Transformation Matrix (205): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (337): 0
libinput Natural Scrolling Enabled Default (338): 0
libinput Scroll Methods Available (339): 0, 0, 1
libinput Scroll Method Enabled (340): 0, 0, 0
libinput Scroll Method Enabled Default (341): 0, 0, 0
libinput Button Scrolling Button (342): 2
libinput Button Scrolling Button Default (343): 2
libinput Middle Emulation Enabled (344): 0
libinput Middle Emulation Enabled Default (345): 0
libinput Rotation Angle (346): 0.000000
libinput Rotation Angle Default (347): 0.000000
libinput Accel Speed (348): 0.264706
libinput Accel Speed Default (349): 0.000000
libinput Accel Profiles Available (350): 1, 1
libinput Accel Profile Enabled (351): 1, 0
libinput Accel Profile Enabled Default (352): 1, 0
libinput Left Handed Enabled (353): 0
libinput Left Handed Enabled Default (354): 0
libinput Send Events Modes Available (322): 1, 0
libinput Send Events Mode Enabled (323): 0, 0
libinput Send Events Mode Enabled Default (324): 0, 0
Device Node (325): "/dev/input/event8"
Device Product ID (326): 1133, 50180
libinput Drag Lock Buttons (355): <no items>
libinput Horizontal Scroll Enabled (356): 1
on Ubuntu 20.04.3 LTS
and xserver-xorg-core-2:1.20.11-1ubuntu1~20.04.2
with xinput version 1.6.3
, XI version on server: 2.3
Solution 1:
Not possible now because libinput doesn't have feature parity with evdev yet (well, the right answer is actually "install archlinux :)" since they already have a package with the patch, but I will try to write up a work around for Ubuntu here)
There is a patch floating but not yet merged. https://wiki.archlinux.org/title/Libinput#Mouse_wheel_scrolling_speed_scaling
Workaround is to manually apply a simpler version of the patch: instructions are:
- Clone https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput.git
- install base developer packages to compile this code
sudo apt install xserver-xorg-dev libinput-dev
- Follow the rest of the instructions on https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/12#note_636816
(note that the change will make scroll 3x faster. just change the number to what you want. If you don't know about ldconfig etc, just reboot after
sudo make install
)- read the comments. there are some caveats, such as impacting game input.
- if you are fine with the caveats, here are simplified steps from that
dpkg -l | grep xserver-xorg-input-libinput
- take note of the version and ignore the
-1
suffix as that is the ubuntu repackage version. I am not sure what you will lose if that number is over 1, might be missing out security updates so proceed with caution. - checkout the git branch with your version from above. my example was
git checkout xf86-input-libinput-0.29.0
because my version was0.29.0-1
- either apply the patch from the comment or edit the file directly (it is a single line change).
vim src/xf86libinput.c
at the end of methodcalculate_axis_value(...
addvalue *= 3;
before that variable is last used, to multiply it by three before the value is returned. - install the build dependencies for the package
sudo apt-get build-dep libinput
- build the code
autoreconf -vif
./configure --prefix=/usr
make
- install the new files
sudo make install
- reboot. your mouse scrolling should me 3x faster. If you want to tweak the speed, repeat the steps above starting from the point you edited the file.