鼠标滚轮向相反方向滚动
鼠标滚轮向相反方向滚动。 我进入了系统设置>鼠标和触摸板>自然滚动 ,但无论我选择哪个选项,它仍然向我的方向滚动。
我做了一些其他步骤,比如我的主目录中的.map*
文件,但它也没有用。
我确实重新启动了整台笔记本电脑,所以也许会有东西粘在上面,但不是,它会继续向另一个方向滚动。
您必须使用xinput来禁用自然滚动。
开放终端:
~$ xinput list
输出应该是这样的:
⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ USB Keyboard id=10 [slave pointer (2)] ⎜ ↳ ImPS/2 BYD TouchPad 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)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Power Button id=8 [slave keyboard (3)] ↳ USB Keyboard id=9 [slave keyboard (3)] ↳ USB Keyboard id=12 [slave keyboard (3)]
看,TouchPad id = 11。
~$ xinput list-props 11
输出应该是这样的:
Device 'ImPS/2 BYD TouchPad': Device Enabled (135): 1 Coordinate Transformation Matrix (137): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Accel Speed (274): 0.000000 libinput Accel Speed Default (275): 0.000000 libinput Accel Profiles Available (276): 1, 1 libinput Accel Profile Enabled (277): 1, 0 libinput Accel Profile Enabled Default (278): 1, 0 libinput Natural Scrolling Enabled (271): 1 libinput Natural Scrolling Enabled Default (272): 0 libinput Send Events Modes Available (255): 1, 0 libinput Send Events Mode Enabled (256): 0, 0 libinput Send Events Mode Enabled Default (257): 0, 0 libinput Left Handed Enabled (279): 0 libinput Left Handed Enabled Default (280): 0 libinput Scroll Methods Available (281): 0, 0, 1 ...
看看这个,libinput Natural Scrolling Enabled(271):1。
您需要将其设置为0。
xinput set-prop 11 271 0
这个答案很大程度上是基于grisotto的答案,grisotto可以工作但不能在我的机器上重新启动。
这几乎使过程自动化:
获取指针设备名称:
$ xinput list ⎡ 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 BYD TouchPad 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)]
在我的情况下它是ImExPS/2 BYD TouchPad
虽然它是一个鼠标。 接下来获取libinput Natural Scrolling Enabled
的属性ID:
$ xinput list-props 11 # use the id or the name of the pointer device Device 'ImExPS/2 BYD TouchPad': Device Enabled (119): 1 Coordinate Transformation Matrix (121): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Accel Speed (271): 0.000000 libinput Accel Speed Default (272): 0.000000 libinput Accel Profiles Available (273): 1, 1 libinput Accel Profile Enabled (274): 1, 0 libinput Accel Profile Enabled Default (275): 1, 0 libinput Natural Scrolling Enabled (261): 0 libinput Natural Scrolling Enabled Default (262): 0 libinput Send Events Modes Available (241): 1, 0 [snip]
这是261
。 现在使用指针设备名称(因为id可能在重新启动时更改)和属性id(保持不变)并将这些行放在~/.bashrc
。 在我的情况下它是:
device=$(xinput list --id-only 'ImExPS/2 BYD TouchPad') xinput set-prop $device 261 0
我仍然需要在每次启动时打开和关闭一个终端,因为我的.bashrc
在启动时没有被读取,并且它在.profile
不起作用,但这只是三次点击。
在我的情况下,没有Natural Scrolling
设置,而是Evdev Scrolling Distance
。
第一:找出设备:
xinput list
由于这在每次启动时都会发生变化(请参阅robsn的回答),请按名称获取id并将其存储到var中:
device=$(xinput list --id-only 'Logitech USB Laser Mouse')
仔细检查您是否真的拥有房产Edev Scrolling Distance
:
xinput list-props $device
然后设置它:
xinput set-prop $device "Edev Scrolling Distance" -1 1 1
要在每次启动时启用此function,请将device=
和set-prop
命令添加到~/.xsessionrc
文件中。
禁用自然滚动。 禁用两个手指滚动。
我也使用xinput来反转车轮的方向。 我的电脑中车轮方向的属性是Evdev Scrolling Distance (272)
。 此外,您可能需要退出nautilus并重新启动nautilus:
nautilus -q nautilus -n
保存此更改。
这个答案是robsn对方法的自动化 ,使得它在每次启动时执行。
获取指针设备名称:
$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Logitech USB Optical Mouse id=9 [slave pointer (2)] ⎜ ↳ PS/2 Generic Mouse id=13 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=14 [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)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ CHICONY HP Basic USB Keyboard id=10 [slave keyboard (3)] ↳ HP HD Webcam id=11 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)] ↳ HP Wireless hotkeys id=15 [slave keyboard (3)] ↳ HP WMI hotkeys id=16 [slave keyboard (3)]
就我而言,’罗技USB光电鼠标’。
然后在路径中创建一个natural_scrolling.sh文件:
#!/bin/bash device=$(xinput list --id-only 'Logitech USB Optical Mouse'); xinput set-prop $device 295 1 exit 0;
(用鼠标名替换’罗技USB光电鼠标’)。
为文件添加执行权限。 然后打开启动应用程序,并在“命令”行指向该文件时创建一个新条目。
这会自动为我自然滚动。
(注意:如果你正在使用ubuntu-tweak,DISABLE自然滚动,因为它似乎与这个方法冲突 – 我启用它,它导致一些应用程序滚动另一种方式)。
感谢提到自然滚动,Ubuntu调整有一个切换,(我按下假设它会使滚动更柔和或什么)永远不会假设具有该名称的function。
对于阅读此内容的人来说,还希望通过GUI切换该选项。 您可以安装Ubuntu调整并在tweaks>杂项>自然滚动下找到该选项。
这个网站有一个.deb用于Ubuntu调整。 http://ubuntuhandbook.org/index.php/2016/05/install-ubuntu-tweak-in-ubuntu-16-04/