xorg.conf ButtonMapping 不工作(可能被覆盖?)

xorg.conf ButtonMapping 不工作(可能被覆盖?)

我有一个想要配置的蓝牙鼠标,我的 99-eleocmtrackball.conf 文件如下/etc/X11/xorg.conf.d所示:

Section "InputClass"
    Identifier  "evdev mouse"
    Driver  "evdev"
    MatchProduct  "ELECOM TrackBall"
    MatchIsPointer  "yes"
    Option  "EmulateWheel"              "true"
    Option  "EmulateWheelButton"    "8"
    Option  "AccelProfile" "flat"
    Option  "AccelSpeed" "-0.9"
    Option  "ButtonMapping"     "3 2 3 4 5 0 0 8 9"
EndSection

虽然滚轮模拟可以很好地与按钮 8 配合使用,但未应用 ButtonMapping,并且鼠标输入采用默认设置。我的/var/log/Xorg.0.log文件如下所示:

[    19.805] (II) config/udev: Adding input device ELECOM TrackBall (/dev/input/mouse1)
[    19.805] (**) ELECOM TrackBall: Applying InputClass "evdev mouse"
[    19.805] (II) Using input driver 'evdev' for 'ELECOM TrackBall'
[    19.805] (**) ELECOM TrackBall: always reports core events
[    19.805] (**) evdev: ELECOM TrackBall: Device: "/dev/input/mouse1"
[    19.805] (EE) evdev: ELECOM TrackBall: Unable to query fd: Inappropriate ioctl for device
[    19.820] (EE) PreInit returned 2 for "ELECOM TrackBall"
[    19.820] (II) UnloadModule: "evdev"
[    19.905] (II) config/udev: Adding input device ELECOM TrackBall (/dev/input/event18)
[    19.905] (**) ELECOM TrackBall: Applying InputClass "evdev pointer catchall"
[    19.905] (**) ELECOM TrackBall: Applying InputClass "evdev keyboard catchall"
[    19.905] (**) ELECOM TrackBall: Applying InputClass "evdev mouse"
[    19.905] (II) Using input driver 'evdev' for 'ELECOM TrackBall'
[    19.905] (**) ELECOM TrackBall: always reports core events
[    19.905] (**) evdev: ELECOM TrackBall: Device: "/dev/input/event18"
[    19.905] (**) evdev: ELECOM TrackBall: ButtonMapping '3 2 3 4 5 0 0 8 9'
[    19.905] (--) evdev: ELECOM TrackBall: Vendor 0x56e Product 0x151
[    19.906] (--) evdev: ELECOM TrackBall: Found 12 mouse buttons
[    19.906] (--) evdev: ELECOM TrackBall: Found scroll wheel(s)
[    19.906] (--) evdev: ELECOM TrackBall: Found relative axes
[    19.906] (--) evdev: ELECOM TrackBall: Found x and y relative axes
[    19.906] (--) evdev: ELECOM TrackBall: Found absolute axes
[    19.906] (II) evdev: ELECOM TrackBall: Forcing absolute x/y axes to exist.
[    19.906] (--) evdev: ELECOM TrackBall: Found keys
[    19.906] (II) evdev: ELECOM TrackBall: Configuring as mouse
[    19.906] (II) evdev: ELECOM TrackBall: Configuring as keyboard
[    19.906] (II) evdev: ELECOM TrackBall: Adding scrollwheel support
[    19.906] (**) Option "EmulateWheel" "true"
[    19.906] (**) Option "EmulateWheelButton" "8"
[    19.906] (**) evdev: ELECOM TrackBall: YAxisMapping: buttons 4 and 5
[    19.906] (**) evdev: ELECOM TrackBall: EmulateWheelButton: 8, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[    19.906] (**) Option "config_info" "udev:/sys/devices/virtual/misc/uhid/0005:056E:0151.000D/input/input19/event18"
[    19.906] (II) XINPUT: Adding extended input device "ELECOM TrackBall" (type: KEYBOARD, id 15)
[    19.906] (**) Option "xkb_rules" "evdev"
[    19.906] (**) Option "xkb_model" "pc105"
[    19.906] (**) Option "xkb_layout" "kr"
[    19.906] (**) Option "xkb_variant" "kr104"
[    19.906] (WW) Option "xkb_options" requires a string value
[    19.906] (II) evdev: ELECOM TrackBall: initialized for relative axes.
[    19.906] (WW) evdev: ELECOM TrackBall: ignoring absolute axes.
[    19.906] (**) ELECOM TrackBall: (accel) keeping acceleration scheme 1
[    19.906] (**) ELECOM TrackBall: (accel) acceleration profile 0
[    19.906] (**) ELECOM TrackBall: (accel) acceleration factor: 2.000
[    19.906] (**) ELECOM TrackBall: (accel) acceleration threshold: 4

Configuring as keyboard我该如何让 ButtonMapping 选项工作?行后的日志是否Configuring as mouse正常?如果您需要任何其他信息,请告诉我。谢谢!

ps 我使用的是 16.04,xinput --list如下所示:

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SINO WEALTH USB KEYBOARD                  id=10   [slave  pointer  (2)]
⎜   ↳ ELECOM TrackBall                          id=15   [slave  pointer  (2)]
⎜   ↳ Logitech M325                             id=8    [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)]
    ↳ Power Button                              id=7    [slave  keyboard (3)]
    ↳ SINO WEALTH USB KEYBOARD                  id=9    [slave  keyboard (3)]
    ↳ Cooler Master Technology Inc. AMD SR4 lamplight Control   id=11   [slave  keyboard (3)]
    ↳ Cooler Master Technology Inc. AMD SR4 lamplight Control   id=12   [slave  keyboard (3)]
    ↳ Mistel MD600 RGB                          id=13   [slave  keyboard (3)]
    ↳ Mistel MD600 RGB                          id=14   [slave  keyboard (3)]

答案1

我以前使用 xorg.conf 进行按钮映射。但如果我想更改映射,我必须重新启动。最近我转向绑定键xte作为xautomation更通用的替代方案。要点是添加xbindkeys到您的~/.xprofile~/.xinitrc文件并编辑~/.xbindkeysrc

这是我的~/.xbindkeysrc

# Fn2 to middle btn
"xte 'mouseclick 2'"
  b:10+Release

# Fn3 to right btn
"xte 'mouseclick 3'"
  b:12+Release

# Forward/Back
"xte 'key Page_Up'"
  b:9+Release
"xte 'key Page_Down'"
  b:8+Release

https://wiki.archlinux.org/index.php/Mouse_buttons#Binding_mouse_to_keyboard_buttons

相关内容