Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 735  / 3 Years ago, sun, june 13, 2021, 10:17:19

I have an Apple Mighty Mouse, but it's been banged up a bit. The side buttons (4th buttons) are way too easily pressed. When I'm using Firefox, the 4th button can accidentally click and I'd go back one page, which can be really aggravating. How can I disable the 4th button (on either Firefox or Ubuntu) without getting any new hardware?


More From » firefox

 Answers
2

Those buttons (forward and back) drive me crazy too! Here's what worked for me:



Open a terminal (CtrlAltT by default), and run:



$ xev | grep -A2 ButtonPress


This will pop open a window. Move the mouse into that window, and press the button(s) that you wish to disable. Look at the third line for each button-press, which will look something like:



ButtonPress event, serial 37, synthetic NO, window 0x4000001,
root 0x2f2, subw 0x0, time 355888399, (114,122), root:(114,174),
state 0x10, button 8, same_screen YES


Note the number after button. For me, the back/forward buttons were numbers 8 and 9.
Close the xev window, and create/edit an .Xmodmap file in your home directory:



$ cat >> ~/.Xmodmap
! Disable buttons 8 and 9
pointer = 1 2 3 4 5 6 7 0 0


In your case, to just disable button 4, you'd want pointer = 1 2 3 0 5 6 7 8 9.
Press CtrlD to return to the prompt, then test it out:



$ xmodmap ~/.Xmodmap 


This will load the .Xmodmap file and your button(s) should be disabled immediately.



Most desktop environments should load this file automatically next time you log in, making the change permanent.



This is an old question, but I hope this answer helps someone.


[#30494] Sunday, June 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eryeath

Total Points: 122
Total Questions: 121
Total Answers: 112

Location: Saint Helena
Member since Fri, Aug 26, 2022
2 Years ago
;