出于某种原因,我想倒置使用轨迹球 Logitech(又名 Logicool)Marble Mouse(又名 Trackman Marble)。有没有一种方法可以在不修改硬件的情况下通过软件方式分别反转左右滚动和上下滚动?我通过编写配置文件来尝试此操作,/etc/X11/xorg.conf.g/
例如
Section "InputClass"
Identifier "Marble Mouse"
MatchProduct "Logitech USB Trackball"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "8"
Option "XAxisMapping" "6 7"
Option "Emulate3Buttons" "true"
Option "ButtonMapping" "1 2 3 5 4 7 6 2 2"
EndSection
关键的部分是我交换了键 4 和 5 以及 6 和 7,这样就可以:
Option "ButtonMapping" "1 2 3 4 5 6 7 2 2"
我有:
Option "ButtonMapping" "1 2 3 5 4 7 6 2 2"
但这不起作用,并且这可能仅对滚轮模拟模式有效。如何反转滚动?
答案1
在游戏中,我们将其称为“反转鼠标”。
Option "InvX" "boolean"
Invert the X axis. Default: off.
Option "InvY" "boolean"
Invert the Y axis. Default: off.
答案2
xinput
如果您使用如下方式,则可以反转滚动:
xinput set-button-map "Logitech USB Trackball" 1 2 3 4 5 6 7 8 9
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Button" 8 8
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation" 8 1
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation Axes" 8 6 7 4 5
xinput set-int-prop "Logitech USB Trackball" "Evdev Wheel Emulation X Axis" 8 6
xinput set-int-prop "Logitech USB Trackball" "Evdev Drag Lock Buttons" 8 9
答案3
聚会迟到了,但我找到了正确的解决方案。我有一个 Kensington Orbit 轨迹球,因此请相应地调整“sed”字符串。
## Invert mouse axels, two button trackball
for id in $(xinput --list | sed -n '/Kensington USB\/PS2 Orbit/s/.*=\([0-9]\+\).*/\1/p')
do
# Shift left-right mousebutton 3 _ 1 disable all other 0 0 0 0
xinput set-button-map $id 3 0 1 0 0 0 0
# Invert mouse axels. see https://wiki.ubuntu.com/X/InputCoordinateTransformation
xinput set-prop $id 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
done