There is a button on my mouse which hibernates my system and I want to map it to do nothing. This button was originally mapped to do something else in Windows using the Windows software that came with the mouse, but that software is not available for Ubuntu. I don't know why it is now mapped to the power button.

I have been trying to use xinput to remap buttons but the button in question does not show up in xinput get-button-map <device id> so I don't know how to change it. The device in question is a Genius X-G500.

My devices according to xinput list:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Genius X-G500                             id=12   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=15   [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)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ HID 0566:3002                             id=9    [slave  keyboard (3)]
    ↳ HID 0566:3002                             id=10   [slave  keyboard (3)]
    ↳ Genius X-G500                             id=11   [slave  keyboard (3)]
    ↳ Laptop_Integrated_Webcam_HD               id=13   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=14   [slave  keyboard (3)]
    ↳ Dell WMI hotkeys                          id=16   [slave  keyboard (3)]

Running xinput test 12 and then pressing buttons on the mouse produces normal results (eg. 1 for left click, 2 for middle click, 3 for right click, etc.) but when I press the button in question it produces the code 124. This number is of course only visible when I switch my computer on again after it has hibernated.

Running xinput get-button-map 12 shows this:

1 2 3 4 5 6 7 8 9 10 11 12 13 

I don't know what 10, 11, 12, and 13 are, because my mouse does not have that many buttons. But I would have expected to see 124 somewhere which I do not see. This is what is confusing me because now I cannot remap it to 0

Running xmodmap -pk shows (among other things):

    124     0x1008ff2a (XF86PowerOff)   0x0000 (NoSymbol)   0x1008ff2a (XF86PowerOff)   

so it makes sense that 124 is the power button. I don't know if there is a way to change this mapping using xmodmap or another tool but I haven't been able to find it... I have also tried typing xev and then pressing this key but there is no output.

I am new to X and so I don't really know what I am doing. I have googled a lot and the idea of using xinput or xmodmap came from my googling.

Any help appreciated. Thanks.


I hope this helps: https://askubuntu.com/a/492745

I would suggest using xinput test and simply pressing the buttons you want to change. Once you know the actual button ID you can remap it temporarily with xinput on the CLI, or permanently by writing a custom ~/.xsessionrc as shown in the above answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.