jamie.lentin.co.uk

Logitech Cordless Trackman Optical under Linux

It's not as good as the Trackman Marble FX, but it is cordless, and has lots o' buttons. It is detected as a USB mouse quite happily, it can't report the "lock" button if connected as PS/2 though.

Smartscroll Mode

Apparently it can do something called "smart scroll". No idea what this is supposed to mean, apart from when it's on the wee buttons will report a scroll-button press as well as their own. Great. Both lmctl and lomoco will let you turn it off, however lomoco is in an unfathomable state atm, whilst lmctl still works for what we want. Compile / install .deb, then you can use a udev rule like:

SUBSYSTEM=="usb", ATTR{manufacturer}=="Logitech", ATTR{bDeviceClass}=="00", ATTR{bDeviceSubClass}=="00" \
  , RUN+="/usr/bin/lmctl -b $env{BUSNUM} -d $env{DEVNUM} -8 --no-sms"

Xorg configuration

So long as you use the evdev driver, all the buttons should work just fine. You can reorder the buttons using xmodmap, by supplying a space- separated list of the new button order. Alas you can't duplicate buttons, it has to be a 1-1 mapping. Adding the following to .Xmodmap will...:

pointer = 1 9 3 4 5 11 12 8 2 10 6 7
  • Make the "up" side button (7) the middle button
  • Make the small up/down buttons (9 & 10) the horizontal scroll buttons
  • Jumble the remaining buttons to the top

Assigning functions to remaining buttons

You can use xbindkeys and xvkbd to map all the extra buttons now at your disposal to key events. E.g. my .xbindkeysrc says:

# Double-up button: Home
"/usr/bin/xvkbd -xsendevent -text '\[Home]'"
   m:0x0 + b:6
# Double-dn button: Home
"/usr/bin/xvkbd -xsendevent -text '\[End]'"
   m:0x0 + b:7
# Back button: Alt-Left (i.e. back in most browsers)
"/usr/bin/xvkbd -xsendevent -text '\A\[Left]'"
   m:0x0 + b:8
# Lock button: Ctrl-T (i.e. new tab)
"/usr/bin/xvkbd -xsendevent -text '\Ct'"
   m:0x0 + b:10

Ideally I'd also want to rotate the pointer movement 225 degrees and use the "down" side button for pretend scroll-wheeling, but alas the evdev driver doesn't let you do that.