我使用鼠标键盘组合作为我的工作站的主要输入设备。
电脑也连接到我的电视。看电视时我喜欢使用带触摸板的廉价键盘。它没有品牌,但背面写着:
Wireless Keyboard
Model: ST-WK600
Art. nr.: IW.48.788
由于我习惯在 MacBook 上“自然滚动”,因此我也想将其用于我的触摸板。
但是,我希望鼠标的行为像默认情况下一样。
gnome-control-center
仅显示鼠标和触摸板的一种设置。是否可以设置每个设备的滚动行为?
编辑:
hwinfo --short
输出,减少到相关部分。
正如您所看到的,它包括我的 Logitech 键盘、MCE USB 接收器和unknown: Keyboard controller
,我怀疑这是键盘触摸板组合,因为没有触摸板部分,并且/dev/input/mice
只列出了一个设备。
keyboard:
/dev/input/event6 Logitech LX710 Cordless Desktop Laser
/dev/input/event17 MCE IR Keyboard/Mouse (mceusb)
mouse:
/dev/input/mice Logitech LX710 Cordless Desktop Laser
unknown:
FPU
DMA controller
PIC
Keyboard controller
Intel 7 Series/C216 Chipset Family MEI Controller #1
Intel 7 Series/C216 Chipset Family SMBus Controller
Feature Integration Technology Inc. (Fintek) F71610A or F71612A Consumer Infrared Receiver/Transceiver
/dev/input/event2 P&E Micro Smart Control
ASUSTek BCM20702A0
编辑2:xinput list
输出。其中一种HLHB155
设备应该是触摸板。
$ xinput list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ HLHB155 V1 10 27 01 Smart Control id=10 [slave pointer (2)]
⎜ ↳ HLHB155 V1 10 27 01 Smart Control id=11 [slave pointer (2)]
⎜ ↳ Logitech USB Receiver id=14 [slave pointer (2)]
⎜ ↳ MCE IR Keyboard/Mouse (mceusb) id=16 [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)]
↳ HLHB155 V1 10 27 01 Smart Control id=9 [slave keyboard (3)]
↳ Media Center Ed. eHome Infrared Remote Transceiver (1934:5168) id=12 [slave keyboard (3)]
↳ Logitech USB Receiver id=13 [slave keyboard (3)]
↳ Eee PC WMI hotkeys id=15 [slave keyboard (3)]
↳ HLHB155 V1 10 27 01 Smart Control id=17 [slave keyboard (3)]
↳ Logitech USB Receiver id=18 [slave keyboard (3)]
↳ MCE IR Keyboard/Mouse (mceusb) id=19 [slave keyboard (3)]
答案1
gsettings set org.gnome.desktop.peripherals.mouse natural-scroll false
gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll true
如果您收到没有这样的钥匙,运行dconf
并搜索滚动或者滚动。
答案2
这不是一个真正的解决方案,但这是我编写的一个小 python 脚本,用于切换显示缩放和鼠标方向,用于在桌子(鼠标和 100%)和沙发(触控板和 200%)之间切换。
希望它有帮助。
#!/usr/bin/python3
import subprocess
import sys
current = subprocess.check_output([
'gsettings',
'get',
'org.gnome.desktop.interface',
'scaling-factor'
])
if current == b'uint32 2\n':
scale = 1
natural = 'false'
elif current == b'uint32 1\n':
scale = 2
natural = 'true'
else:
sys.exit('cannot determine current scale')
subprocess.call([
'gsettings',
'set',
'org.gnome.desktop.interface',
'scaling-factor',
'%d' % (scale,)
])
subprocess.call([
'gsettings',
'set',
'org.gnome.settings-daemon.plugins.xsettings',
'overrides',
"{'Gdk/WindowScalingFactor': <%d>}" % (scale,)
])
subprocess.call([
'gsettings',
'set',
'org.gnome.desktop.peripherals.mouse',
'natural-scroll',
natural
])