udev キーマップ

udev キーマップ

システム全体のキーマッピングにudevルールを使用したいと思います。 /etc/udev/hwdb.d/my-custom.hwdb XPS15 9570を
作成しました。

# Map Caps Lock to Control
# I copied from /lib/udev/hwdb.d/60-keyboard.hwdb
# Used to be
# evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDell*:pnXPS*:pvr* 
#  KEYBOARD_KEY_8c=!unknown

evdev:atkbd:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr* 
 KEYBOARD_KEY_3a=leftctrl

そして

$ sudo systemd-hwdb update
/etc/udev/hwdb.d/my-custom.hwdb:19: Property expected, ignoring record with no properties
$ sudo udevadm trigger /dev/input/event0

しかし、これはうまくいきません。
簡単だと思いましたが、今はめまいです。

$ sudo evtest
...
Event: time 1583562939.539691, -------------- SYN_REPORT ------------
Event: time 1583562942.556894, type 4 (EV_MSC), code 4 (MSC_SCAN), value 3a
Event: time 1583562942.556894, type 1 (EV_KEY), code 58 (KEY_CAPSLOCK), value 1
Event: time 1583562942.556894, -------------- SYN_REPORT ------------
Event: time 1583562942.663607, type 4 (EV_MSC), code 4 (MSC_SCAN), value 3a
Event: time 1583562942.663607, type 1 (EV_KEY), code 58 (KEY_CAPSLOCK), value 0
Event: time 1583562942.663607, -------------- SYN_REPORT ------------
Event: time 1583562942.663986, type 17 (EV_LED), code 1 (LED_CAPSL), value 0
Event: time 1583562942.663986, -------------- SYN_REPORT ------------
Event: time 1583562943.321883, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1583562943.321883, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
$ udevadm info -a -p $(udevadm info -q path -n /dev/input/by-path/platform-i8042-serio-0-event-kbd )

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '//devices/platform/i8042/serio0/input/input0/event0':
    KERNEL=="event0"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '//devices/platform/i8042/serio0/input/input0':
    KERNELS=="input0"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{uniq}==""
    ATTRS{name}=="AT Translated Set 2 keyboard"
    ATTRS{phys}=="isa0060/serio0/input0"
    ATTRS{properties}=="0"

  looking at parent device '//devices/platform/i8042/serio0':
    KERNELS=="serio0"
    SUBSYSTEMS=="serio"
    DRIVERS=="atkbd"
    ATTRS{scroll}=="0"
    ATTRS{description}=="i8042 KBD port"
    ATTRS{firmware_id}=="PNP: PNP0303"
    ATTRS{err_count}=="0"
    ATTRS{extra}=="0"
    ATTRS{set}=="2"
    ATTRS{softraw}=="1"
    ATTRS{force_release}=="140,369-370"
    ATTRS{softrepeat}=="0"
    ATTRS{bind_mode}=="auto"

  looking at parent device '//devices/platform/i8042':
    KERNELS=="i8042"
    SUBSYSTEMS=="platform"
    DRIVERS=="i8042"
    ATTRS{driver_override}=="(null)"

  looking at parent device '//devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

関連情報