Various Logitech mice implement hi-res scrolling. This means instead of having the content move 3 lines on each scroll click, you can scroll per-pixel using many more precise scroll events sent by the mouse. This gives you a precise and smooth experience in applications that support it.
This currently requires X, as Wayland 1.20 does not yet support this. It seems Wayland 1.21 will support this, but probably in a different way.
Enabling the feature
First off, we need to enable the high resolution scrolling feature on your
mouse. Solaar is able to do this.
Install it using the PPA. We also install libinput-tools
to verify if the
settings were applied correctly.
add-apt-repository ppa:solaar-unifying/stable
apt update
apt install -y solaar libinput-tools
sudo cp /usr/lib/udev/rules.d/42-logitech-unify-permissions.rules /etc/udev/rules.d/
Run solaar
and enable Scroll Wheel Resolution. You may need to unlock the
setting by clicking on the lock icon next to it twice.
Scroll resolution
Now scrolling will be awfully fast, so we need to tell each scroll event matches 1 pixel instead of the default 15. Horizontal scrolling still uses an ordinary wheel click, so we need to make sure that wheel behaves as before.
If you have an MX 3 mouse, just copy the block below, else look up the name of
your mouse using xinput
. This will for example be Logitech MX Master 3
for a
USB connected MX Master 3, or MX Master 3 Mouse
if the same device is
connected through Bluetooth. As more devices may support this, for example the
Logitech MX Anywhere 3
, we use a string also matching that device name.
Create a new udev hwdb file called /etc/udev/hwdb.d/71-logitech-mice.hwdb
and
enter the following:
mouse:*:name:*MX * 3*:
MOUSE_WHEEL_CLICK_ANGLE=1
MOUSE_WHEEL_CLICK_COUNT=360
MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL=26
MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL=14
This will match all MX Master 3 and MX Anywhere 3 mice connected through USB or Bluetooth.
Reload these settings using the following commands.
sudo systemd-hwdb update
sudo udevadm trigger /dev/input/event*
Now check if these were applied correctly, by running the following command,
moving your mouse to have it picked up and then interrupting (Ctrl-C
) the
command.
sudo libinput debug-events | grep MX
You’ll see something like:
-event30 DEVICE_ADDED MX Anywhere 3 Mouse seat0 default group12 cap:p left scroll-nat scroll-button
We need event30
. Now run:
udevadm info /dev/input/event30 # replace with your device number
and check if our new settings were applied.
P: /devices/virtual/misc/uhid/0005:046D:B025.0006/input/input34/event30
[...]
E: MOUSE_WHEEL_CLICK_ANGLE=1
E: MOUSE_WHEEL_CLICK_COUNT=360
[...]
To verify if the scrolling events are parsed correctly, run the following and see if a small vertical scrolling number is shown when giving your scroll wheel a small nudge.
sudo libinput debug-events --verbose
[...]
event30 POINTER_SCROLL_WHEEL +3.142s vert 2.00/240.0* horiz 0.00/0.0 (wheel)
Here we see vert 2.00
. If that number is still high, you may need to reboot.
I’m currently unsure what service needs restarting to have that number applied
correctly.
Enjoy your new smooth scrolling!
Application specific
Some applications don’t play well with smooth scrolling, and some don’t recognize it by default. This may change over time, so here’s some examples if you encounter problems.
Firefox1
Firefox will wait for 15 scrolled pixels before moving down 15 pixels using
their own smooth scrolling setup. We need to tell Firefox we’re using xinput2
as follows:
echo "export MOZ_USE_XINPUT2=1" | sudo tee /etc/profile.d/use-xinput2.sh
and disable the built-in smooth scrolling in about:preferences
. Search for
Use smooth scrolling and disable it.
You need to log out and back in again for the above to work. You can also try it
out by closing firefox and then running it from a terminal using
MOZ_USE_XINPUT2=1 firefox
.
Virtualbox
Scrolling in a guest in Virtualbox will be much worse now since xinput
s
Motion events won’t reach the guest. So you’ll need to scroll quite fast for
the ButtonPress events to be generated and then passed to the guest. There
doesn’t seem to be a way to fix this, so we need to disable XInput 2 support
when starting a Virtualbox guest by setting QT_XCB_NO_XI2=1
. We can’t do this
through the interface, so we need to start a guest using:
QT_XCB_NO_XI2=1 VBoxManage startvm <Guest VM name or UUID>
And now we have regular (non-smooth) scrolling in that guest.