Enabling middle click using a Kensington Trackball in Ubuntu 15.10

Recently I’ve been trying out a trackball to see if it relieves pain in my lower arm / wrist - after some consideration I choose the Kensington Orbit Trackball as it seemed to be the one that required least configuration to get working on Linux as it has a scroll ring and two buttons so appears just like a normal mouse. However there is no middle click so I wanted to enable clicking both buttons simultaneously to replace that. After trying various methods the following seemed most successful.

Kensington Orbit Trackball

There are various ways to persist this setting, however I found the most foolproof to be to edit ~/.profile to include the line:

xinput --set-prop --type=int --format=8 "Primax Kensington Eagle Trackball" "Evdev Middle Button Emulation" "1"

Editing the settings this way rather than hacking the files in /usr/share/X11… means the settings are nicley contained in my home folder and can easily be transfered to other machines or when I upgrade rather than potentially getting overwritten or forgotten if the core config files are removed / changed.

If you have a slightly different model of trackball you can find a list of input device names just by running xinput with no parameters on the command line.

This method likley works for other versions of Ubuntu but I’ve only verified it on 15.10.