![禁用 Logitech 轨迹球的“返回”](https://linux22.com/image/876095/%E7%A6%81%E7%94%A8%20Logitech%20%E8%BD%A8%E8%BF%B9%E7%90%83%E7%9A%84%E2%80%9C%E8%BF%94%E5%9B%9E%E2%80%9D.png)
我有一个带有四个按钮的 Logitech Marble Mouse 轨迹球:
使用此处的说明,我已经50-marblemouse.conf
设置了(xorg.conf),这样按住“后退”按钮就可以滚动:
Section "InputClass"
Identifier "Marble Mouse"
MatchProduct "Logitech USB Trackball"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "8"
EndSection
但是,有时“按住”会被注册为单击“返回”,这在我浏览网页时非常烦人。 有什么方法可以使用按钮滚动但禁用单击?
通常的解决方法似乎是使用“前进”按钮进行滚动,因为单击该按钮大多是无害的,但我发现用无名指单击该按钮比用拇指单击后退按钮要尴尬得多。
答案1
我认为您要找的选项是 ButtonMapping。我的鼠标也有类似的烦人功能(https://www.kensington.com/en/no/4493/k72327eu/slimblade-trackball),所以不久前就弄清楚了这一点。
即使您禁用按钮或重新分配映射,“EmulateWheelButton”选项仍然有效......
现在,我只在 evdev 上用 xinput 测试过。用 xinput 测试要快得多,然后您只需将脚本添加到“启动应用程序”中,而不必修改 /etc/X11/ 并反复重新启动 X。
因此这应该是您在 xorg.d/mouse.conf 中所需要的全部内容(如果您不想使用登录脚本为每个用户执行此操作,则需要注释掉的行),但如果您使用 xinput,则可能根本不需要这些:
Section "InputDevice"
Identifier "Configured Mouse"
Driver "evdev"
Option "Device" "/dev/input/mice"
Option "Protocol" "auto"
#Option "EmulateWheel" "1"
#Option "EmulateWheelButton" "8"
#Option "ButtonMapping" "1 2 3 4 5 6 7 0 9 10 11 12"
EndSection
以下是我为找出解决方案所做的事情(显然,在以下命令中用您的设备替换我的设备):
显示设备:
$ xinput list
Virtual core pointer id=2 [master pointer (3)]
↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
↳ ELAN Touchscreen id=11 [slave pointer (2)]
↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)]
↳ Kensington Kensington Slimblade Trackball id=18 [slave pointer (2)]
查看该设备支持哪些属性:
$ xinput list-props "Kensington Kensington Slimblade Trackball"
Device 'Kensington Kensington Slimblade Trackball':
Device Enabled (142): 1
Coordinate Transformation Matrix (144): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (273): 0
Device Accel Constant Deceleration (274): 1.000000
Device Accel Adaptive Deceleration (275): 1.000000
Device Accel Velocity Scaling (276): 10.000000
Device Product ID (260): 1149, 8257
Device Node (261): "/dev/input/event17"
Evdev Axis Inversion (277): 0, 0
Evdev Axes Swap (279): 0
Axis Labels (280): "Rel X" (152), "Rel Y" (153), "Rel Vert Wheel" (573)
Button Labels (281): "Button Left" (145), "Button Middle" (146), "Button Right" (147), "Button Wheel Up" (148), "Button Wheel Down" (149), "Button Horiz Wheel Left" (150), "Button Horiz Wheel Right" (151), "Button Side" (679), "Button Unknown" (263), "Button Unknown" (263), "Button Unknown" (263), "Button Unknown" (263)
Evdev Scrolling Distance (282): 1, 1, 1
Evdev Middle Button Emulation (283): 0
Evdev Middle Button Timeout (284): 50
Evdev Third Button Emulation (285): 0
Evdev Third Button Emulation Timeout (286): 1000
Evdev Third Button Emulation Button (287): 3
Evdev Third Button Emulation Threshold (288): 20
Evdev Wheel Emulation (289): 1
Evdev Wheel Emulation Axes (290): 0, 0, 4, 5
Evdev Wheel Emulation Inertia (291): 10
Evdev Wheel Emulation Timeout (292): 200
Evdev Wheel Emulation Button (293): 8
Evdev Drag Lock Buttons (294): 0
现在让我们尝试一下:
$ xinput set-button-map "Kensington Kensington Slimblade Trackball" 1 2 3 4 5 6 7 0 9 10 11 12
$ xinput set-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation" 1
$ xinput set-prop "Kensington Kensington Slimblade Trackball" "Evdev Wheel Emulation Button" 8
现在我的右上角按钮只能起到自动滚动的作用,而不能起到令人恼火的后退行为!
答案2
这是我在 2009 年在 Ubuntu 上对这个非常好的轨迹球的配置。我希望它仍然有效,也许你会在“驱动程序”和“设备”方面发现一些差异。但是,按钮选项应该是相同的。
Code: Section "InputDevice"
Identifier "Marble Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "Emulate3Buttons" "true"
Option "Buttons" "9"
Option "EmulateWheel" "1"
Option "EmulateWheelButton" "8"
Option "YAxisMapping" "4 5"
Option "XAxisMapping" "6 7"
EndSection
因此,我们有:
- 第三个按钮是“前进”(9),非常方便。
- 模拟轮位于“后退”(8)
- 请注意,我定义了 X 轴和 Y 轴,这意味着当用拇指按下“返回”时,您可以使用球向两个方向滚动,就像使用触摸板一样。
答案3
使用您的关联,您可以将后退按钮重新映射为更无害的按钮,例如单击鼠标右键。
不过,我不知道您如何将其与上述配置文件合并。