How do I disable middle mouse key pasting

Help please,
I seem unable to stop middle mouse key, pasting stuff every time I accidentally touch it.
How do I disable it, please?

Its in the System Settings. Just launch the System Settings application and in the first page, in the middle of the window there’s a big button labeled “More Behavior Settings…”

  • if you click it you get to a screen with a bunch more toggles, and in the center there’s the checkbox for “Middle Click: Pastes selected text”:

1 Like

Thank you.
That was the kind of things I was looking for, but…
maybe because mine is not the latest? (…Desktop: KDE Plasma 5.20.5 wm: kwin_x11 vt: 7 dm: SDDM…)
or maybe because it was customised by MX?
mine doesn’t look the same:


so… the search for mouse middle key continues for me…

The fact that you aren’t using the latest Plasma version may definitely be the reason you can’t find that configuration.

Plasma 5.20 is ancient and out of support. The only Plasma 5 version supported is 5.27 and I highly recommend you update to at least that.

I have another PC with the latest MX-23.3
This uses 5.27.5 KDE and still the middle click option is not an option available to set…

sounds like I am going to have to plead with MX guys or find another (terminal?) solution?

Are you on X11? I think the option to disable middle-click-paste is only on Wayland as on X11 it is a built-in feature (of the X11 server) that cannot be disabled.

It is indeed Wayland only - here is the bug report that also discusses X11 alternatives, such as resetting the clipboard selection constantly or remapping the mouse button (if you don’t want to use the middle mouse button at all, like to open links in new tab): 441668 – Please make middle-click pasting optional

1 Like

That may explain it …
This one is:

Display: x11 server: X.Org 1.20.14 compositor: kwin_x11 driver

how about changing to wayland?

for my sins I have nvidia gpu… (I understand this may be a problem)
plus it seems rather complicated (switching to Wayland) from brief look at forums

With a recent NVidia driver (at least 550} it shouldn’t be a problem (tough you need 555 and Plasma 6.1 to fix some issues).

Regarding how complicated it is - I’m not familiar with MX, and I heard that they tend to make things more complicated than necessary for some mistaken sense of “righteousness”, but even on Arch this should be as easy as installing some package.

This has worked perfectly for me in the end:
https://forum.mxlinux.org/viewtopic.php?p=781499#p781499

Case closed (and clearly nothing to do per se with KDE)

I wouldn’t disable it, as select+MMBpaste is much safer:

https://www.bleepingcomputer.com/news/security/dont-copy-paste-commands-from-webpages-you-can-get-hacked/

maybe so, but the question here is not “what is safer”
the question is “how do you prevent accidental and un-intended pasting when using mouse middle scroll/button”
It is solved as far as I am concerned, unless you have another/better solution?

There’s no better solution as you found it already, I’m just informing you and anyone else interested about the benefits of the select-paste method which does strictly copy text.

Unless you are offended that you 've learned something new judging from your offensive tone…

You heard wrong G. I can tell you that the mx I’m running on some partition is the best kde experience I’ve had so far in a good while. Zero issues. I wouldn’t even know what “they tend to make things more complicated” means. Some other distros on the other hand… Couldn’t care less that they have a “younger” kde edition. Anywho, the problem seems solved.

Hello peeps,

I am writing because the thread did not really got to a solution. However, I think I just figured out what to do. For context, my setup is a Thinkpad with the latest Kubuntu: Kubuntu 24.04.1 LTS x86_64. This solution works to disable the Trackpoint middle button as well as a USB mouse peripheral.

Without further ado, here is what you do:

  1. First, list all your devices with xinput list on the terminal.
  2. Get the name of the “Virtual core pointer” that you identify as the peripheral you want to target. Then run xinput set-button-map "Device name" 1 0 3 where you personalize it with the name of your choosing. Example for my setup: xinput set-button-map "AlpsPS/2 ALPS DualPoint Stick" 1 0 3.

Do that for all the peripherals you want to modify.

Caveat: This works only for the current session. You need to run it again every time you log out or reboot. It will also reset every time you unplug the mouse. For it to work all the time, you can likely automate the process with the approach of your choosing. What follows is just what I have done that works for me and my workflows:

  1. Create a bash script that runs a command or commands as before:
#!/bin/bash
xinput set-button-map "AlpsPS/2 ALPS DualPoint Stick" 1 0 3
xinput set-button-map "Logitech G203 LIGHTSYNC Gaming Mouse" 1 0 3
  1. Go to “Shortcuts” in “System Settings” where you can add a command. Choose the file where you have saved your script and assign a keyboard shortcut that works for you.

Done!

Now, every time I plug in a mouse peripheral I just press my shortcut and the middle button stops working.

Hope this helps.

An xinput based solution will only work when you run an X11 session. It will not work in a Wayland session.

If you want to have a permanent X11 input button map, you can create a configuration file in /etc/X11/xorg.conf.d with your desired input configuration.

See this stack exchange answer for details: x11 - xorg .conf file remaps buttons for all devices, not just the one specified - Unix & Linux Stack Exchange