How to configure Logitech Marble trackball

This is always what I've done. it works a peach for every trackman I've ever used. It's the last, simplest step from the official ubuntu page.

~/trackman.sh:

#!/bin/bash

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`


chmod +x ~/trackman.sh

then, whenever you login (or in a startup script), bash ~/trackman.sh

Done. This tiny little scripts works much, much better than the official ~60mb windows installer IMHO :)


i've got that configuration and it worked very well until i upgraded to Debian Stretch.... and what's happens ? 'evdev' is not used anymore; because 'libinput' replaced it.

Check the lib used :

xinput list-props "Logitech USB Trackball"

If you find many props starts with 'Evdev', forget my comment, ELSE if it starts with 'libinput', this line could do the thing :

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

Too, i recommend THIS for confort :

# Enable middle button (on 9) and disable all useless and conflicting buttons and others.
xmodmap -quiet -e "pointer = 1 0 3 4 5 6 7 0 2 0 0 0" 

( And NOT THIS : xmodmap -quiet -e "pointer = 1 0 3 4 5 6 7 8 2 10 11 12" which only says to use middle button (2) instead of Browser Next (9). You need to say to use only scrolling - then nothing - when you click on Browser Prev (8) )

RECAP So, with these modifications, you've got a ball and 4 usable buttons (1-BIG 2-small 3-small 4-BIG) on the trackball.

  • A ball -> mouse move + mouse scroll if you press button 2.
  • Button 1 -> classic left button
  • Button 2 -> Press it to scroll with the ball
  • Button 3 -> middle button (usefull to copy selection in linux)
  • Button 4 -> classic right button