我知道如何让另一个按钮充当中间按钮,但如何将几个鼠标按钮映射到中间按钮?
xmodmap
如果我在选项中重复按钮号码,就会出现抱怨pointer
。
答案1
我认为您可以配置Option "ButtonMapping"
鼠标的Section "InputDevice"
。xorg.conf
您应该将物理按钮设置为逻辑按钮2
。
例如:
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
Option "ButtonMapping" "1 2 3 4 5 2"
EndSection
答案2
要使左右按钮同时按下时充当中间按钮,您需要激活 3 键模拟。在较旧的 Xorg 版本中,请在xorg.conf 的Option "Emulate3Buttons" "yes"
相应部分中进行设置。InputDevice
在 Xorg 1.4 到 1.7 中,添加一个 HAL 配置 fdi 文件,例如:
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
<!--
Default X.org input configuration is defined in:
/etc/hal/fdi/policy/30user/10-x11-input.fdi
Settings here modify or override the default configuration.
See comment in the file above for more information.
To see the currently active hal X.org input configuration
run lshal or hal-device(1m) and search for "input.x11*" keys.
Hal and X must be restarted for changes here to take any effect
-->
<match key="info.capabilities" contains="input.mouse">
<merge key="input.x11_options.Emulate3Buttons" type="string">on</merge>
</match>
</device>
</deviceinfo>
在 Xorg 1.8 及更高版本中,在 xorg.conf.d 目录中添加一个文件,例如:
Section "InputClass"
Identifier "middle button emulation class"
MatchIsPointer "on"
Option "Emulate3Buttons" "on"
EndSection