11

EDIT: recently I bought another trackball (ProtoArc EM03) and had to do this configuration again. So I thought in writing a detailed guide on how to configure any pointing device in Ubuntu based distros that organized the information in this question better. So I did I and as this post is viewed a lot by people trying to configure their pointing devices I thought in sharing it here. You can access it in this link: https://www.reddit.com/r/Trackballs/comments/1fp7upa/how_to_configure_any_pointing_device_on_ubuntu/

---Original question below---

I just got a Kensigton Slimblade Trackball and I'm trying to configure it. I'm adapting it from my old Logitech Marble configuration.

I want the configuration to be:

  • Left-Bottom: Left click
  • Left-Top: Backward
  • Right-Top: Right click and ball scroll lock
  • Right-Bottom: Middle click

The configuration I could set until now is:

  • Left-Bottom: Left click
  • Left-Top: Middle click
  • Right-Top: Right click and ball scroll lock
  • Right-Bottom: Backward

This is my configuration script:

xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Middle Button Emulation" 8 1 xinput set-button-map "Kensington Kensington Slimblade Trackball" 1 2 8 4 5 6 7 xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation" 8 1 xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Button" 8 8 xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Axes" 8 6 7 4 5 xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Timeout" 16 300 

Before running this script, xev reports button numbers as:

Left-Bottom: 1, Left-Top: 2, Right-Top: 8, Right-Botom: 3 

After running this script:

Left-Bottom: 1, Left-Top: 2, Right-Top: 8, Right-Botom: 8 

So AFAIK, xinput set-button-map changes button order. In this page, I learned that the 2nd value corresponds to the middle mouse button, and the 8th to the Thumb1 (normally related to backward function). So I thought I should just use number 3 as the 2nd element and 2 as the 8th element like this:

xinput set-button-map "Kensington Kensington Slimblade Trackball" 1 3 8 4 5 6 7 2 

but now the top-left button has right-click function and left-bottom is disabled. xev now reports

Left-Bottom: 1, Left-Top: 3, Right-Top: 2, Right-Botom: 8. 

Anyone knows how I set the configuration as I intend ? I'm using Ubuntu 16.04. Thanks.

3 Answers 3

8

A few minutes after I post the question I found the answer. Here goes in case anyone needs it (configuration for Mint 18/Ubuntu 16.04):

xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Middle Button Emulation" 8 0 7 8 9 xinput set-button-map "Kensington Kensington Slimblade Trackball" 1 8 2 4 5 6 7 3 2 xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation" 8 1 xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Button" 8 8 xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Axes" 8 6 7 4 5 xinput set-int-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Timeout" 16 300 

Edit

After upgrading for Mint 19 (at home) and Ubuntu 18.04 (at office) I found the configuration above doesn't work. 18.04 uses a different library for these kind of devices (libinput) and even if I reinstalled Evdev some options don't work. After a painful search I found the solution. Create a a file with .conf extension in /usr/share/X11/xorg.conf.d/ folder. In my case I named it 10-slimblade.conf. Put this configuration inside the file:

Section "InputClass" Identifier "Kensington Kensington Slimblade Trackball" MatchProduct "Kensington Kensington Slimblade Trackball" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Driver "libinput" Option "ButtonMapping" "1 8 2 4 5 6 7 3 2" Option "ScrollButton" "8" Option "ScrollMethod" "button" Option "MiddleEmulation" "on" EndSection 

Restart session, and that's it.

4

Thanks so much! Just to add on a bit, I was able to find that these are how the buttons are on the trackball:

--------- | 2 | 8 | --------- | 1 | 3 | --------- 

And this is the order they are in the ButtonMapping string:

LeftClick MiddleClick RightClick ScrollUp ScrollDown ScrollLeft ScrollRight Back Forward 

So, for me, I just wanted right and left on the bottom row, with back top left and middle top right:

Section "InputClass" Identifier "Kensington Kensington Slimblade Trackball" MatchProduct "Kensington Kensington Slimblade Trackball" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Driver "libinput" Option "ButtonMapping" "1 8 3 4 5 6 7 2 9" Option "ScrollButton" "8" Option "ScrollMethod" "button" EndSection 

The documentation here is non-existent, so this is what I could piece together by running xev -event mouse.


Here is a map from button ID to its function:

Button Function
1 left click
2 middle click
3 right click
4 scroll up
5 scroll down
6 scroll left
7 scroll right
8 back
9 forward
0

Beautiful, thanks guys! :) Had to modify slightly to make it work for me, though. Since on my system (Ubuntu 18.04) xinput reports the trackball like this:

$ xinput list | grep Kensington ⎜ ↳ Kensington Slimblade Trackball id=14 [slave pointer (2)] 

I had to modify MatchProduct from your examples above to make that work for me. Also I slimmed it down a tiny bit. On my end it looks like this and that worked for me:

Section "InputClass" Identifier "My Kensington Slimblade Trackball" MatchProduct "Kensington Slimblade Trackball" Option "ButtonMapping" "1 8 3 4 5 6 7 2 9" Option "ScrollButton" "8" Option "ScrollMethod" "button" EndSection 
1
  • In "make it work" it's not clear what "it" refers to. Maybe improve than answer. And you don't have to add "thanks"; upvote instead. Commented Jan 8, 2022 at 23:53

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.