Years ago, after problems with my wrist, I moved to using a trackball when ever I can. Good move it was too, but I am left with one pain. I use a Logitech Marble Mouse and it has no scroll wheel; this is sad because I have loved scroll wheels since they came out. So, instead, I use scroll wheel emulation — you hold down a button and trackball moves are interpreted as scroll events.

Now, this leaves me with one remaining pain. For no readily apparent reason, the method for configuring it has moved from one place to another, normally every couple of releases. At one point, it was in xorg.con, then in HAL, for a joyful period with the gpointer-settings GUI which then broke and disappeared, and I ended up with xinput run from a shell script.

Having just upgrading to Ubuntu 17.04 guess what? Broken again.

I have been using this:

xinput set-button-map "Logitech USB Trackball" 1 2 3 4 5 6 7 8 9
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 8
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Axes" 8 6 7 4 5
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation X Axis" 8 6
xinput set-int-prop "Logitech USB Trackball" "Evdev Drag Lock Buttons" 8 9

Well from a bug report here:

https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1682193/comments/7

It turns out that the reason this no longer works is because Evdev is not used anymore, thanks to the move to Wayland; now I need to use libinput. Unfortunate, since these “big” linux issues (unity, wayland, systemd) are something that I try very hard not to have to care about at all.

I tried lots of dead reckoning with libinput but got all sorts of errors, or just non-functioning. Eventually, I worked out the right way forward this way.

xinput --list
 Virtual core pointer                      id=2    [master pointer  (3)]
   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
   ↳ HID 1267:0103                             id=11   [slave  pointer  (2)]
   ↳ Logitech USB Trackball                    id=12   [slave  pointer  (2)]

Which gives the device number (12). Then

xinput --list-props 12
Device 'Logitech USB Trackball':
    Device Enabled (136):   1
    libinput Scroll Methods Available (284):    0, 0, 1
    libinput Scroll Method Enabled (285):   0, 0, 1
    libinput Scroll Method Enabled Default (286):   0, 0, 1
    libinput Button Scrolling Button (287): 2
    libinput Button Scrolling Button Default (288): 2

This is mostly correct — the last 1 on Scroll Method Enabled means “button”. But the 262 on Button Scrolling Button is not so good. It needs to be 8.

Next up, set-int-prop is deprecated, so lets not use that. So I tried this instead:

xinput set-prop 12 287 8

The 12 is the device number, 287 is the property number (found from --list-props above), and the 8 is the correct button. But this is ugly and incomprehensible; more, I do not know if the numbers (12 and 287) will remain the same across all my computers. So, let’s use names instead.

xinput --set-prop "Logitech USB Trackball" "libinput Button Scrolling Button" 8

Which leaves me with these properties:

xinput --list-props 12
Device 'Logitech USB Trackball':
    Device Enabled (136):   1
    libinput Scroll Methods Available (284):    0, 0, 1
    libinput Scroll Method Enabled (285):   0, 0, 1
    libinput Scroll Method Enabled Default (286):   0, 0, 1
    libinput Button Scrolling Button (287): 8
    libinput Button Scrolling Button Default (288): 2

In the end, the configuration is simple. Now, please, please devs, don’t break it again!

  • Update

The original post was wrong but settings from earlier experiments were persisting when I thought they were not.