Kensington Expert Mouse Ubuntu Configuration

First identify the Expert Mouse’s device ID using xinput:
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Kensington Kensington Expert Mouse id=9 [slave pointer (2)]
⎜ ↳ Dell KB216 Wired Keyboard id=11 [slave pointer (2)]
⎜ ↳ DELL Laser Mouse id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Dell KB216 Wired Keyboard id=10 [slave keyboard (3)]
↳ Dell WMI hotkeys id=13 [slave keyboard (3)]

Next, get the ID of the button to change using “xinput test device_id”, e.g., this is the output from pressing the upper right button:
$ xinput test 9
button press 8
button release 8

Physical button positions:
1 = Lower left button
2 = Upper left button
3 = Lower right button
4 = Upper right button
5 = scroll ring

Button actions:
1 = left click
2 = middle click
3 = right click
8 = back

Normally the physical button positions are assigned the same button actions. The command to do this (in case you wanted to reset to default) is xinput --set-button-map 9 1 2 3 4 5 6 7 8 (again, where 9 is the device ID).

In my case, middle-click is assigned to the upper left button and back is assigned to the upper right. I wanted to swap them, so the command is:
xinput --set-button-map 9 1 8 3 4 5 6 7 2
where 9 is the device ID and “1 8 3 4 5 6 7 2” are the actions assigned to the first eight physical positions.

To persist these settings, add the xinput command to ~/.xsessionrc. For more details see How to configure the TrackPoint.