Answers:
我想你可以配置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
要将左右按钮作为中间按钮按下时,需要激活3按钮仿真。在较旧的Xorg版本中,请Option "Emulate3Buttons" "yes"
在InputDevice
xorg.conf 的相应部分中进行设置。
在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