xinput
说我的鼠标是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)]
将按钮 4 和 5 设置为 0 即可:
$ 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
但是,鼠标滚轮滚动功能并未禁用。有什么办法吗?Ubuntu 18.04.3。
预计到达时间:请注意,答案被接受于如何在 ubuntu 11.04 或 10.10 中禁用鼠标滚轮滚动?不起作用,至少就我而言。
埃塔2:根据要求添加:
$ 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
答案1
移除libinput
sudo apt remove 'xserver-xorg-input-libinput.*'
鼠标将由其处理,evdev
并且所有以前的解决方案都将起作用。