For ergonomical reasons, I’ve been a long-time user of Trackballs as pointing devices instead of using regular mice. For several years now, I have been using a Logitech Trackman Marble together with a libinput tweak to use the trackball for scrolling by holding down one of the buttons while spinning the ball.

This worked well until some distributions decided to switch to using Wayland as a replacement for X.org. In the past, I have been reverting back to using X.org (by setting WaylandEnable=True in /etc/gdm/custom.conf), as Wayland does not support the required libinput configurations. I found a workaround that creates a shared library that can be preloaded to implement this, but that looked somewhat hacky to me.

But as Wayland seems to be the way forward and my latest distribution upgrade caused some weird X.org issues (my dual-screen setup did not longer work properly), I caved in and switched to Wayland again. At least all of my screens were properly detected afterwards, but scroll wheel emulation was broken. I did some research if the libinput support in Wayland had improved in that regard in the meanwhile, but it seems it doesn’t.

However, I found a solution for enabling mouse wheel emulation in Wayland/GNOME3 on the Arch Linux Wiki: simply run the following command in a terminal window:

gsettings set org.gnome.desktop.peripherals.trackball scroll-wheel-emulation-button 8

Now button 8 (the small button above the left button) acts both as a “back” button (e.g. when browsing web pages) as well as the modifier that turns the trackball into a scroll wheel, just like before. Nifty!

I’ve been struggling with this for quite some time now, but I finally figured out how to enable scroll wheel emulation for the Logitech Trackman Marble on Fedora Linux 24.

Previously (when I was using Ubuntu Linux), I had a small shell script that defined the required xinput properties. However, this did not work on Fedora, as they use the new libinput framework.

With the change to the libinput subsystem, you can now enable this behavior by creating a file /etc/X11/xorg.conf.d/10-libinput.conf with the following content:

Section "InputClass"
 Identifier "Marble Mouse"
 MatchProduct "Logitech USB Trackball"
 Driver "libinput"
 Option "ScrollMethod" "button"
 Option "ScrollButton" "8"
 EndSection

Magically, this function got enabled as soon as I saved the file, without even having to restart X! I’m impressed.

Update: this solution does no longer work on later versions of Fedora that switched to Wayland instead of X.org by default. If you don’t want to switch back to X.org and you’re using the GNOME desktop environment, you can enable scroll wheel emulation as outlined here.