Evoluent mouse 4 with Fedora 21 (and other distros)

I recently bought a vertical mouse to take care of my health, considering how many hours I spend each day clicking and using the mouse on PCs. Moreover I started a completely new experience in the GNU/Linux world using a RedHat like distribution: Fedora. This doesn’t mean I will not use anymore my beloved Debian, but I think I need to improve my GNU/Linux knowledge. Anyway this article will focus on how to configure Evoluent Mouse 4 with Fedora 21. The goal is to have the buttons on the left part of the mouse (for the thumb) loading the previous page read in the browser and the consequent next page (basically going back to the previous page).

Just to clarify, the Mouse will work immediately after you plug in it into a USB port. What I needed to do was the mapping of the buttons.

The first step to do is to check what is the current ID assigned to the mouse. To achieve this goal we will use the command line and in particular the tool xinput in this way (from root user):

# xinput list

The output will be similar to this one:

⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ Kingsis Peripherals Evoluent VerticalMouse 4    id=10    [slave  pointer  (2)]

As you can see my Evoluent mouse has been assigned with an ID of 10. So, from now on, we will work using that ID with the next commands:

# xinput <option> <id>

 The option that we will need to use is set-button-map. Before doing it let me explain how it works because it took me some time to get it 🙂

Imagine to have a table with two columns. The left column will provide the association between a number and an action within the GNU/Linuix environment. The right column will have, on the contrary the association between a number and the corresponsant mouse button. Something like the following:

Left click / 1        –     Left button / 1
Central click / 2     –     Central button / 2
Right click / 3        –     Right button / 3
etc…            –    Etc.

Now, if I want to assign the action of the left click to my right button, I will need to map it in some way. The current default mapping can be obtained with the command:

# xinput –get-button-map 10
The output will show you something like this:

# xinput –get-button-map 10
1 2 3 4 5 6 7 8 9 10 11 12 13 14

 What that means is: to action correspondant to number 1, use the mouse button number 1; to action correspondant to number 2, use the mouse button number 2 and so on. You can find the default mapping of actions here.

Now, if you want, for example, to assign the action correspondant to left click (action number 1), to the right mouse button (identified by number 3), all you have to do is changing the first number of the previously mentioned get-button-map to have on position 1 the number 3. To better exaplain, we want to have an output like this one:

# xinput –get-button-map 10
>3< 2 3 4 5 6 7 8 9 10 11 12 13 14

How to get this? Very easy… we will use again xinput but with a different option:

# xinput –set-button-map 10 3 2 3 4 5 6 7 8 9 10 11 12 13 14

That said, to achieve my goal I had to change the button mapping in this way:

# xinput –set-button-map 10 1 2 3 4 5 6 7 9 2 8 11 12 13 14

The problem with the above command is that it will work till the next reboot. So the last step to take is to have this mapping permanently working.
Let’s first starting identifying the USB ID:

# lsusb
Bus 004 Device 004: ID 1a7c:0191 Evoluent VerticalMouse 4

Once we get the ID (in my case is 1a7c:0191) we can create the file /usr/share/X11/xorg.conf.d/90-evoluent_mouse.conf with the following content:

Section “InputClass”
Identifier “Evoluent”
MatchUSBID “1a7c:0191
Option “ButtonMapping” “1 2 3 4 5 6 7 9 2 8 11 12 13 14”

We are done.

Related Post

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.