Logitech M570 Trackball buttons in Linux

I find it difficult to find a mouse I actually like. Most are too small, and moving one around a lot can be a literal pain.

So when a friend mentioned that she used a Logitech M570 trackball, I had a look. Hmmmm. I'd used a trackball before (another friend's Logitech USB Marble Mouse) and found it interesting, so when I found someone selling a s/h M570 inexpensively (not everyone likes trackballs, fortunately), I bought it.

Iff you are right-handed as I am, it's very nice and fits my (right) hand perfectly. This, and the wireless connection via Logitech's tiny 'Unifying' USB receiver, makes it much better than the corded Marble Mouse which is ambidextrous but at the cost of having an odd arrangement for your fingers.

It also 'just works' almost perfectly in Linux.

The 'almost' bits are that there's no supplied utility to control the pairing between the USB receiver and the trackball – as supplied, they work together fine, but if you want to pair another Logitech device with it, you need to boot into Windows or OS X to do so…

… until someone wrote Solaar.

There's also no supplied utility to alter what the buttons do. As supplied, the two small buttons by the 'left mouse button' move forward or backwards in a browser. Hmm, given how easy it is to move the mouse pointer and do that via the browser's buttons, that's not terribly useful. It's also not what I want to do most of the time: I want to page up or down something much more. But how?

Here's how on a Debian-based system like Linux Mint or Ubuntu:

cd ~
sudo apt-get install xbindkeys xautomation

Create a file ~/.xbindkeysrc and put

"xte 'key Page_Up'"
b:9

"xte 'key Page_Down'"
b:8

(when 'button 9' is pressed, run the xte program to emulate a 'PgUp' keystroke, and similarly when 'button 8' is pressed, emulate a 'PgDn' keystroke) in it with your favourite text editor. Run

xbindkeys

.. and it should now work. If you've messed up and want to try again, use

killall -HUP xbindkeys

to stop xbindkeys, edit the .xbindkeysrc, and restart it. Repeat until happy 🙂

Don't forget to add xbindkeys to the programs that start up on every time you log in…


Comments

Logitech M570 Trackball buttons in Linux — 4 Comments

  1. Thank you so much! This was just what I needed. Some of the other tutorials went into way too much detail and I got lost. Yours is very clear and direct.

Leave a Reply

Your email address will not be published.