Skip to navigation

Binding a key to the middle mouse button with xmodmap and xkbset

Great, I just found this here. This is how you can bind a key to the middle mouse button (I use the middle mouse button a lot to (a) paste stuff from the clipboard, (b) open links in background tabs in Firefox). I used the pause/break key, so it’s slightly modified. I first had to get xkbset via aptitude.

sudo aptitude install xkbset
xmodmap -e 'keysym Pause Break = Pointer_Button2'
xkbset m
xkbset exp =m

I don’t know yet whether this will persist after a reboot.

3 Responses to “Binding a key to the middle mouse button with xmodmap and xkbset”

  1. Thomas Says:

    Thanks! Works great for me after experimenting for an hour with other (not working) google results. Unfortunately your post is not awarded enough ranking level to find it quickly.

  2. Tom Dignan Says:

    Exactly what I needed for this laptop! The touchpad is designed in a way that I can’t press left and right click simultaneously, ergo, no Emulate3Buttons for me.

  3. Will Says:

    Thanks, my laptop touchpad was unusable. If you put the last 3 lines in a bash script and run it at startup it should work every time.