2

I'm trying to configure my mouse side-buttons to go back/forward on Firefox and Ubuntu.

When i run xev | grep ', button' I get the same button code for both side-buttons and scroll. So I clicked scroll, then left side-button then right side-button and got the following output:

    state 0x10, button 2, same_screen YES
    state 0x210, button 2, same_screen YES
    state 0x10, button 2, same_screen YES
    state 0x210, button 2, same_screen YES
    state 0x10, button 2, same_screen YES
    state 0x210, button 2, same_screen YES

So, I have three buttons with the same number/code? Is there anything I can do to assign a different code for each button? Or is it a hardware issue?

PRATAP
  • 22,460
Mutante
  • 123
  • Ok, but my mouse have 5 buttons (left, right, left sidebutton, right sidebutton and scroll). When i run xev | grep ',button' the terminal shows that left sidebutton, right sidebutton and scroll has the same button number (2) as show on my output console. So if i assing to my left sidebutton go back, then the righ sidebutton and scroll will go back too, because they have the same button number. – Mutante Apr 07 '19 at 06:35

1 Answers1

1

Run the command xmodmap -pp

out put will be similar to like this

pratap@i7-6550U:~$ xmodmap -pp
There are 10 pointer buttons defined.

    Physical        Button
     Button          Code
        1              1
        2              2
        3              3
        4              4
        5              5
        6              6
        7              7
        8              8
        9              9
       10             10

pratap@i7-6550U:~$ 

this means when the Physical Button 1 is pressed the Button Code 1 function will be done which is just a mouse click. In your case you have pressed the middle mouse button first and then side buttons in which the middle mouse button is button 2, that is correct. left side and right side buttons should have a value of 6 & 7 (my guessing only)

in general left click, middle mouse button, right click, scroll down, scroll up are Physcial Buttons 1 to 5.

In your case you need to map Physical Buttons 6 & 7 to Button Codes 6 & 7.

run the command xmodmap -pp and see what is showing for Physical Buttons 6 & 7

then run xmodmap -e "pointer = 1 2 3 4 5 6 7"

Example:

pratap@i7-6550U:~$ xmodmap -e "pointer = 1 2 3 4 5 6 7" Warning: Only changing the first 7 of 10 buttons. pratap@i7-6550U:~$

xmodmap -e "pointer = 1 2 3 4 5 6 7" command works instantly but will not survive logout or reboot. add this command in start up applications Preferences once you are satisfied with this mapping.

when ever you want to go back to default behaviour, run xmodmap -e "pointer = default" and delete the entry from start up application.

source: http://manpages.ubuntu.com/manpages/bionic/man1/xmodmap.1.html

Check what are the functions doing by pressing your mouse Physical Buttons in actual by clicking them.. if they are intended to do back/ forwarded out of the box, that's fine. If they do nothing. Map those keys to do back/ forward from this Q&A binding back/forward to mouse buttons

Edit:

According to the website of your mouse vendor http://www.sentey.com/br/whirlwindx there should be a software for configuring side buttons but i did not find any link to it. Also the support for this mouse is only to the OS'es Windows & MacOs it seems.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Contenet in this Question or exended comments may give a clue similar to your situation. Ubuntu 18.04 how to disable power save?

PRATAP
  • 22,460
  • I did what you said, but when I ran xmod -pp my output was exactly like yours. It was not showing that button 6 and 7 was with the button 2 function. I ran the command xmodmap -e 'pointer = 1 2 3 4 5 6 7" but when I test it using xev it still appears that the sidebuttons are with code 2. – Mutante Apr 07 '19 at 19:06
  • Sentey Whirlwind X model GS-3320 – Mutante Apr 07 '19 at 21:23
  • So if I change the button function on Windows, in Ubuntu will be changed too? (Using VM in this case)... – Mutante Apr 08 '19 at 14:59
  • hope so, thats what the OP's experience. Did you get the software? i tried to get the link.. but that website is in Portuguese and the translation is not that user friendly. – PRATAP Apr 08 '19 at 15:04
  • if it is possible for you to access Windows or macOs.. install that software first, then connect the mouse and change settings.. then it should work in Ubuntu without VM.. – PRATAP Apr 08 '19 at 15:07