Ignore 命令有效,但 ButtonMapping 无效。
我创建了一个文件/usr/share/X11/xorg.conf.d/39-myinput.com
:
Section "InputClass"
Identifier "Apple MagicKeyboard"
MatchIsKeyboard "on"
MatchProduct "Magic Keyboard"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "Ignore" "off"
Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0"
EndSection
此时我只是在测试 ButtonMapping,但它似乎没有任何效果。你能为我指出正确的方向吗?
我曾经evtest
确定键 16 和 17 是Qand
W:
Event: time 1512268567.675999, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70014
Event: time 1512268567.675999, type 1 (EV_KEY), code 16 (KEY_Q), value 0
Event: time 1512268567.675999, -------------- SYN_REPORT ------------
Event: time 1512268568.531055, type 4 (EV_MSC), code 4 (MSC_SCAN), value 7001a
Event: time 1512268568.531055, type 1 (EV_KEY), code 17 (KEY_W), value 1
Event: time 1512268568.531055, -------------- SYN_REPORT ------------
...并且我已0
在我的KeyMapping
字符串中将它们设置为禁用它们,但在重新启动 X 后我没有发现它们被禁用。但是,如果我将Ignore
指令更改为on
而不是off
,我确实发现我的整个 MagicKeyboard 被禁用(而我的其他连接的键盘仍然有效)。
我的xorg.conf.d
目录包含以下内容:
10-amdgpu.conf
10-evdev.conf
10-quirks.conf
10-radeon.conf
11-evdev-quirks.conf
11-evdev-trackpoint.conf
39-myinput.conf
40-libinput.conf
51-synaptics-quirks.conf
70-synaptics.conf
70-wacom.conf
我的/var/log/X.log.0
包含以下内容:
[196248.970] (II) config/udev: Adding input device Magic Keyboard (/dev/input/event20)
[196248.970] (**) Magic Keyboard: Applying InputClass "Apple MagicKeyboard"
[196248.970] (**) Magic Keyboard: Applying InputClass "evdev keyboard catchall"
[196248.970] (**) Magic Keyboard: Applying InputClass "libinput keyboard catchall"
[196248.970] (**) Magic Keyboard: Applying InputClass "Apple MagicKeyboard"
[196248.970] (**) Magic Keyboard: Applying InputClass "Apple MagicKeyboard"
[196248.971] (II) Using input driver 'evdev' for 'Magic Keyboard'
[196248.971] (**) Magic Keyboard: always reports core events
[196248.971] (**) evdev: Magic Keyboard: Device: "/dev/input/event20"
[196248.971] (**) evdev: Magic Keyboard: ButtonMapping '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 0'
[196248.971] (--) evdev: Magic Keyboard: Vendor 0x4c Product 0x267
[196248.971] (--) evdev: Magic Keyboard: Found 3 mouse buttons
[196248.971] (--) evdev: Magic Keyboard: Found absolute axes
[196248.971] (II) evdev: Magic Keyboard: Forcing absolute x/y axes to exist.
[196248.971] (--) evdev: Magic Keyboard: Found keys
[196248.971] (II) evdev: Magic Keyboard: Forcing relative x/y axes to exist.
[196248.971] (II) evdev: Magic Keyboard: Configuring as mouse
[196248.971] (II) evdev: Magic Keyboard: Configuring as keyboard
[196248.971] (**) evdev: Magic Keyboard: YAxisMapping: buttons 4 and 5
[196248.971] (**) evdev: Magic Keyboard: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[196248.971] (II) XINPUT: Adding extended input device "Magic Keyboard" (type: KEYBOARD, id 12)
[196248.972] (II) evdev: Magic Keyboard: initialized for absolute axes.
[196248.972] (**) Magic Keyboard: (accel) keeping acceleration scheme 1
[196248.972] (**) Magic Keyboard: (accel) acceleration profile 0
[196248.972] (**) Magic Keyboard: (accel) acceleration factor: 2.000
[196248.972] (**) Magic Keyboard: (accel) acceleration threshold: 4
我正在运行 Ubuntu 17.04。
ButtonMapping 是一个指针函数(用于鼠标),但您设置了 MatchIsKeyboard,这意味着您正在尝试将其应用于键盘。键盘没有按钮。您可以通过以下方式检查:
接着
无论如何,您可能不想为此使用 evdev 函数,您想更改听起来像的键盘映射。