Running 20.04.2 LTS, using a Microsoft Comfort Optical Mouse 3000. The thumb button (left edge of mouse) functions as "forward" and I want to change it to "back". Any tips?
Asked
Active
Viewed 208 times
0
-
Have you tried `xev` to identify the button and then remapping it? – Pedro Maimere Jun 21 '21 at 14:44
-
Pedro: Not until you just mentioned it. I'm new to this. I used xev -event mouse and found that it's button 9. Now what? – Ancient Jun 21 '21 at 14:54
1 Answers
0
First, identify your mouse's id through the command xinput. In this example, what we are looking for is the id=9:
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ PIXART USB OPTICAL MOUSE id=9 [slave pointer (2)]
Now, let's discover all the buttons available on your mouse and their order, using the command xinput --list <id>, substituting <id> for your mouse's id found earlier:
$ xinput --list 9
PIXART USB OPTICAL MOUSE id=9 [slave pointer (2)]
Reporting 7 classes:
Class originated from: 9. Type: XIButtonClass
Buttons supported: 7
Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right"
Now we know how many buttons are supported, and their order, given by "Button labels". In the example, "Button Left" is 1, "Button Middle" is 2, and so on.
I don't know the exact order of the buttons of your mouse, as you should discover it as described above. But suppose your "Back button"'s number is 6 and "Forward button"'s number is 7, and there are 11 buttons supported. Run this command, substituting <id> for your mouse's id:
xinput set-button-map <id> 1 2 3 4 5 7 6 8 9 10 11
Pedro Maimere
- 191
- 5
-
Here's the output I got after running xinput as suggested. No button labels! Microsoft Microsoft Optical Mouse with Tilt Wheel Consumer Control id=16 [slave keyboard (3)] Reporting 1 classes: Class originated from: 16. Type: XIKeyClass Keycodes supported: 248 – Ancient Jun 22 '21 at 14:45
-
@Ancient it seems the mouse also creates a slave keyboard, however you found out before with `xev` that it also returned a ButtonPress event, and not a KeyPress event, so, there must be a slave pointer linked to this mouse. Please run `xinput list --long | awk '/master keyboard/{exit}1'` and edit your question with the output. This will allow us to check all your pointers. – Pedro Maimere Jun 23 '21 at 01:36
-
I tried to paste the entire output, but this system is saying it's too long by 5686 characters. Is there another way to share it here? – Ancient Jun 23 '21 at 14:06
-
@Ancient You may use [Pastebin](http://pastebin.com) or [Paste Ubuntu](http://paste.ubuntu.com). – Pedro Maimere Jun 23 '21 at 20:56
-