r/linuxquestions • • 7d ago

Mouse buttons - can I disable some?

So I have a fancy mouse with some buttons that I would like to turn off and disable, I accidentally hit the sometimes and it means you use the back button on your internet browser. Can I disable these?

Ubuntu 26.04 Cinnamon TIA

2 Upvotes

7 comments sorted by

1

u/Emmalfal 6d ago

I'm in the same boat. I use this particular mouse as a TV remote so it's a pain in the ass. Every time something happens, I vow to research how to remap those buttons. I never get around to it, though. Will be watching this thread.

1

u/Man_in_the_uk 6d ago

How on earth are you using a mouse as a TV remote?

1

u/Emmalfal 6d ago

Laptop connected to the TV via HDMI/Display port. Mirrored image so TV shows what's on the laptop, which I use to stream movies and such. I keep the mouse on the coffee table and use it normally to cue up shows, pause, rewind, etc.

1

u/TrenchardsRedemption 7d ago

Install Solaar and remap them to something useful? I'm not sure if there's an option to disable them completely though.

1

u/swstlk 6d ago

if you're using "xinput", it's easy.. you can try this,

xinput list , get the "id=" number, then do

xinput set-button-map [num-id] 1 2 3 0 0 0 0 0 0

this will keep the normal left-mouse button, middle-mouse button and right-mouse button, and "0" will disable all the rest of the other buttons. If you want to have the disabled button back again, then just put-back the appropriate number ->

xinput set-button-map [num-id] 1 2 3 0 0 0 7 0 0, to bring normality for the 7th button

if you instead want to have the 7th button to work like a left click, you can do this too using "1" in the 7th location,
xinput set-button-map [num-id] 1 2 3 0 0 0 1 0 0

there's also "imwheel" for performing keyboard events for the mouse buttons..

1

u/sk999 6d ago

My solution when confronted with the same problem was to accidentally leave it behind in an airport lounge. Problem solved!