xinput
says my mouse is id 11:
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ VirtualBox mouse integration id=9 [slave pointer (2)]
⎜ ↳ ImExPS/2 Generic Explorer Mouse id=11 [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)]
↳ Sleep Button id=7 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
Setting buttons 4 and 5 to 0 works:
$ xinput --set-button-map 11 1 2 3 0 0 6 7 8 9
$ xinput --get-button-map 11
1 2 3 0 0 6 7 8 9
However, mouse wheel scrolling is not disabled. Any ideas what to do about it? Ubuntu 18.04.3.
ETA: Please note that the answer accepted in How to disable mouse wheel scroll in ubuntu 11.04 or 10.10? does not work, at least in my case.
ETA2: Added as per request:
$ xinput list-props 11
Device 'ImExPS/2 Generic Explorer Mouse':
Device Enabled (127): 1
Coordinate Transformation Matrix (129): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (266): 0
libinput Natural Scrolling Enabled Default (267): 0
libinput Scroll Methods Available (274): 0, 0, 1
libinput Scroll Method Enabled (275): 0, 0, 0
libinput Scroll Method Enabled Default (276): 0, 0, 0
libinput Button Scrolling Button (277): 2
libinput Button Scrolling Button Default (278): 2
libinput Middle Emulation Enabled (279): 0
libinput Middle Emulation Enabled Default (280): 0
libinput Accel Speed (281): 0.000000
libinput Accel Speed Default (282): 0.000000
libinput Accel Profiles Available (283): 1, 1
libinput Accel Profile Enabled (284): 1, 0
libinput Accel Profile Enabled Default (285): 1, 0
libinput Left Handed Enabled (270): 0
libinput Left Handed Enabled Default (271): 0
libinput Send Events Modes Available (249): 1, 0
libinput Send Events Mode Enabled (250): 0, 0
libinput Send Events Mode Enabled Default (251): 0, 0
Device Node (252): "/dev/input/event4"
Device Product ID (253): 2, 6
libinput Drag Lock Buttons (272): <no items>
libinput Horizontal Scroll Enabled (273): 1
Remove
libinput
byThe mouse will be handled by
evdev
and all former solutions will work.