How do I disable middle mouse click pasting clipboard?

Right-click somewhere on the desktop and choose Configure Desktop and Wallpaper... from the context menu. This will open the Desktop Folder Settings window. There you can configure the mouse actions:

Desktop Folder Settings window


The following solution globally disables paste on middle click for me while retaining all middle mouse button and clipboard functionality:

Follow the steps described in this answer, that is:

  1. Install xbindkeys xsel xdotool

  2. Place this in ~/.xbindkeysrc

    "echo -n | xsel -n -i; pkill xbindkeys; xdotool click 2; xbindkeys"  
    b:2 + Release
    
  3. Reload xbindkeys -p

In step 2. you may need to remove the + Release part as described in this post, depending on what works on your machine.

Set up xbindkeys to run on startup.

Then open Klipper, e.g. via the clipboard icon in the system tray > right click > Configure Clipboard. Uncheck the option 'Prevent empty clipboard'. Reboot and the problem should be solved.

The latter idea is thanks to milaq's XMousePasteBlock.


Steps for a solution:

  1. Identify the ID/IDs of your device with

    xinput list 
    
  2. Get the button map with

    xinput get-button-map <ID>
    
  3. Set the button action

    xinput set-button-map <ID> 1 <new action>
    

Repeat the last command for as many IDs as your mouse has. 1 stands for the mapping of left-click, then for middle click, etc. Use for <new action> number 0 to disable middle-click, number 1 if you want to make it equivalent to left-click, etc.

There are other possible methods.

Related:

  1. Any updates on disabling middle-click paste?
  2. How do I disable middle mouse button click paste?
  3. Disable mouse middle button click paste on KDE, keeping that button working
  4. https://bbs.archlinux.org/viewtopic.php?id=100940
  5. https://www.reddit.com/r/kde/comments/7a71fa/disable_middleclick_paste_and_just_paste/
  6. Disabling middle mouse button