Disable Linux Mouse Wheel Click Paste

Follow the steps below to disable mouse middle or wheel click button:

  1. First from Terminal run “xinput list” to discover your mouse device name, e.g. in this example it is “Microsoft Microsoft Wheel Mouse Optical®“.
xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Belkin Corporation Flip KVM id=8 [slave pointer (2)]
⎜ ↳ Microsoft Microsoft Wheel Mouse Optical® id=10 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
 ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
 ↳ Power Button id=6 [slave keyboard (3)]
 ↳ Power Button id=7 [slave keyboard (3)]
 ↳ Belkin Corporation Flip KVM id=9 [slave keyboard (3)]
 ↳ LITE-ON Technology USB NetVista Full Width Keyboard. id=11 [slave keyboard (3)]
  1. From the console run xinput get-button-map with the mouse device name above to output the mouse button map. The first three digits (1 2 3) of the button map of interest represent the left, middle, and right mouse buttons. A non-zero digit means the button is enabled. Setting digit 2 to zero  disables the mouse middle or wheel click button, e.g. the map would read 1 0 3 4 5 6 7 is it is disabled.
/usr/bin/xinput get-button-map "Microsoft Microsoft Wheel Mouse Optical®"
1 2 3 4 5 6 7
  1. To disable the wheel click at login create a desktop file, e.g. “mousewheelpasteoff.desktop” with the contents below and save it to ~/.config/autostart folder. The xinput set-button-map command below disables the mouse middle or wheel click button
[Desktop Entry]
Name=Disable mouse wheel click at login
Exec=xinput set-button-map "Microsoft Microsoft Wheel Mouse Optical®" 1 0 3 4 5 6 7
Icon=utilities-terminal
Terminal=false
Type=Application
Categories=Utility;Application;
  1. Alternatively in Terminal run the command directly to disable it only for the current session.
/usr/bin/xinput set-button-map "Microsoft Microsoft Wheel Mouse Optical®" 1 0 3 4 5 6 7

 

One thought on “Disable Linux Mouse Wheel Click Paste

  1. admin Post author

    I would prefer the default for mouse wheel click paste was disabled. For me it has corrupted working script files and emails whilst viewing them by dumping arbitrary paste buffer content into random places whilst scrolling and accidentally clicking the mouse wheel. Admittedly I am heavy handed with my index finger but challenge anyone not to accidentally click the mouse wheel whilst scrolling and editing documents.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *