Disable Linux Mouse Scroll Wheel Click Paste

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

  • From Terminal run following command to disable for the current session
/usr/bin/xinput set-button-map "Microsoft Microsoft Wheel Mouse Optical®" 1 0 3 4 5 6 7
  • For a permanent solution create a desktop file, e.g. “mousewheelpasteoff.desktop” with the contents below and save it to ~/.config/autostart folder. After the next login this script will be run to disable the 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
  • 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)]
  • 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 map represent the left, middle, and right mouse buttons. A non-zero digit means the button is enabled. Setting the digit in position 2 to zero disables the mouse middle or wheel click button, e.g. the map would read 1 0 3 4 5 6 7 if disabled.
/usr/bin/xinput get-button-map "Microsoft Microsoft Wheel Mouse Optical®"

1 2 3 4 5 6 7

One comment on “Disable Linux Mouse Scroll Wheel Click Paste”

  • 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.

Leave a Reply

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

Fill out comment
Enter name