Making a 2-button Trackball Useful on Modern Linux

I was the kind of nerdy kid who read computer catalogues for fun before his tenth birthday, and one of the nerdy things I always wanted was a Logitech Trackman Marble… an early optical trackball with a distinctive patterned ball for the sensor to detect. (So distinctive that they still use it on the modern ones.)

Well, I got one in a box of nerdy hand-me-downs, but it’s the one I was eyeing as a kid, with two buttons and no scroll wheel… that won’t do.

Here’s a little script, adapted from someone else who had a similar problem with a Kensington trackball, which adds the following features:

  • Adjust pointer acceleration so use with a three-monitor spread isn’t an exercise in frustration
  • Press and hold the left button for 300ms without moving the ball to produce a right-button press (This seems to work perfectly well to allow me to do both left- and right-button dragging)
  • The physical right button is remapped as the middle button for clicking purposes.
  • Press and hold the physical right button to use the trackball as a scroll wheel
  • Adjust sensitivity of emulated scroll wheel to be usable for things like tab-switching without physical detents.
  • Enable both vertical and horizontal scrolling on the emulated scroll wheel.
  • Work around the cheap chinese USB-PS/2 adapter using the same name for both keyboard and mouse devices so it’s still possible to reference the pointer device by name. (To find the name of yours, run xinput in a terminal.)

It’s not perfect, since you can’t middle-click drag, and I still need to get some ScratchX to fix some scratches on the ball itself that cause an occasional hitch in its motion, but, aside from that, it’s surprisingly comfortable to use.

I’m not sure how much I’ll actually use it, but it’s nice to have it useful. Enjoy. 🙂

CC BY-SA 4.0 Making a 2-button Trackball Useful on Modern Linux by Stephan Sokolow is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

This entry was posted in Geek Stuff. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution under the same terms as the associated post.

All comments are moderated. If your comment is generic enough to apply to any post, it will be assumed to be spam. Borderline comments will have their URL field erased before being approved.