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!