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?


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.

|improve this answer|||||

its simple. just follow these steps:

  1. Go into system settings found in your dock or by searching after pressing Alt-F2
  2. Go into "mouse and touchpad" (or something similar, thats just what it says for me)
  3. Go change the setting you want
|improve this answer|||||
  • When posting an answer it's always good practice to go through the steps your posting, so you can verify it works! If you had done so you'd see there is no option in Mouse and Touchpad settings for changing the function of extra mouse buttons. – Merri Jul 1 '13 at 23:16
  • i did, i havent done it with his/her specific model, but it did in fact work – Eleuin Jul 1 '13 at 23:18
  • Ah, sorry! I realise now that as I'm using a laptop it only gives me touchpad specific options which don't include any settings for extra buttons. :) – Merri Jul 1 '13 at 23:38

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.