How to disable mouse scroll wheel click to paste in openSUSE / Plasma5?

I keep accidentally clicking the scroll wheel whilst programming, and it’s driving me crazy.

I have an .Xmodmap file in my home directory with the following contents, which used to disable this behaviour (kubuntu 15.10) but it doesn’t seem to work on openSUSE:

pointer = 1 6 3 4 5 2

And I’ve also right clicked on the desktop and disabled the middle scroll wheel there. No dice.

Any suggestions?

You need to disable/remove the “Paste” action for middle button click, not the scroll wheel.
Or lock the widgets, then pasting will not be able to create a new widget either.

No idea about your .Xmodmap problem though, never used that myself.

Sorry, that was badly worded. That is what I did.

Then there should be no reaction when you middle-click on the desktop.

It has no effect for other applications though of course.
Middle-click pastes the current X11 selection, that’s an Xorg feature.

Does it help when you run this in a terminal window inside the X session (as user)?

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

This works as intended here on my openSUSE 13.2 system and disables the middle mouse button completely (i.e. maps it to button 25 which doesn’t exist).

Or use your numbers from your first post there, those work here as well. But those actually swap button 2 (i.e. the middle mouse button) with button 6, which might actually be there on your mouse (it could be a second wheel e.g.).

PS: after a quick look at the xmodmap manpage, you should probably use 0 as second number, this is intended to disable events from the corresponding mouse button.

Thank you so much for this, both 25 and 0 work as the second number. I noticed that I get a warning if I don’t increase the length of the list:

sam@T440s:~$ xmodmap -e "pointer = 1 25 3 4 5 6 7 8 9"
Warning: Only changing the first 9 of 13 buttons.

Both work, but this gives no errors:

xmodmap -e "pointer = 1 0 3 4 5 6 7 8 9 10 11 12 13"

So I’ve put that line (the part in quotation marks) in the .Xmodmap file. Hopefully that’ll be a permanent fix :slight_smile:

As far as I can tell, my USB mouse has 5 buttons not including the scroll wheel (so maybe 8 in total if middle click is one, and up and down are “buttons” too), so I’m not sure how that makes 13. I’m using a Thinkpad T440s with the old trackpad swapped out for a T450s style one with discrete buttons at the top, maybe that’s where some of the extra buttons are coming from? Anyway, problem solved and I’m very grateful, thanks again!

I’ve seen that too, but I suppose you could ignore it.
Or change all 13 buttons, as you did.

So I’ve put that line (the part in quotation marks) in the .Xmodmap file. Hopefully that’ll be a permanent fix :slight_smile:

Should be.
~/.Xmodmap is applied on login, and the ‘0’ disables the 2nd (i.e. middle) mouse button.

If you wanted to do that system-wide (i.e. for all users), you could probably use /etc/X11/Xmodmap.

As far as I can tell, my USB mouse has 5 buttons not including the scroll wheel (so maybe 8 in total if middle click is one, and up and down are “buttons” too), so I’m not sure how that makes 13. I’m using a Thinkpad T440s with the old trackpad swapped out for a T450s style one with discrete buttons at the top, maybe that’s where some of the extra buttons are coming from?

No idea.
But yes, a mouse wheel counts as 2 buttons (one for each direction), or 3 if it is clickable.