Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

Create a .desktop file in


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.

share|improve this answer
This can be useful, too.… – Paolo Feb 22 '15 at 21:28

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

share|improve this answer
As I said in my question, it is not a permanent solution. When I boot my computer, the bad behavior comes back. – kami Oct 21 '11 at 0:34
I even mentioned the same link that you have provided! Have you really read my question?! – kami Oct 21 '11 at 0:34
oh, i missed 'To make this set on a per-user basis, I can plug that line into my ~/.xstartup or other init file. It can also be done via configuring a matching InputClass section on xorg.conf. ' , which would make it persistant. – Journeyman Geek Oct 21 '11 at 0:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .