How can I disable the wheel-button paste feature in Ubuntu?

In Ubuntu, the mouse middle-button (wheel-button) pastes the clipboard contents when clicked. When I'm scrolling it keeps pasting things between my codes and most times I don't notice. I can solve this problem temporarily with doing this. But whenever I reboot the my computer, the behavior comes back.

How can I disable this behavior permanently? I don't want my wheel-button to paste.


Solution 1:

Create a .desktop file in

~/.config/autostart

The easiest way would be to copy an existing autostart .desktop entry and change the exec line to run the xinput command needed to switch off paste.

Once done, this will execute each time you login.

Solution 2:

Assuming you're using ubuntu, they have a guide on how to do it

To sum it up

$ xinput list | grep 'id='

to list all your input devices. Find your mouse there

xinput get-button-map 4

To list all your buttons - you will get a VERY long list of numbers starting with 1 2 3 (which represent left right and middle button)

To disable the middle mouse button

xinput set-button-map 4 1 0 3

to remap it to the left mouse button

xinput set-button-map 4 1 1 3

Scrolling should still work since the scroll wheel is seen as a seperate button

Personally though, swipe + middleclick to copy/paste is awesome