How do I disable middle mouse button click paste?

I use gnome-tweak-tool for disabling middle button paste in Ubuntu 16.04.

  1. Install it

    sudo apt install gnome-tweak-tool
    
  2. Run it by searching "tweak tool" in installed apps or just type gnome-tweak-tool in a terminal.

  3. Go to "Keyboard and mouse" -> "Middle-click paste"
  4. Turn off.

    screenshot

That's it.

Or using just CLI

gsettings set org.gnome.desktop.interface gtk-enable-primary-paste false

Tested on 16.04.


I realise that this is not exactly the answer you want, but you can turn this off in Firefox (e.g. if you don't mind the feature elsewhere, but still want middle click in Firefox to open links in new tabs)

In about:config, set

middlemouse.contentLoadURL false
middlemouse.paste false

Not what you asked, but as this question is linked to from a few places I hope someone finds this answer useful.


Jared Robinson gave a simple solution that works on my machine:

Run the following command:

xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"

To persist this behavior, edit ~/.Xmodmap and add

pointer = 1 25 3 4 5 6 7 8 9

Tags:

Clipboard

Xorg