如何找出哪个 udev hwdb 匹配弄乱了我的密钥?

如何找出哪个 udev hwdb 匹配弄乱了我的密钥?

我购买了 Logitech Unifying 键盘 K270 并运行 Ubuntu 14.04(是的,我正在努力更新它)。一切正常,除了“a”和“b”键由于某种原因颠倒了。

我终于发现是 udev 在搞乱它,但我无法撤消它。

> udevadm info /dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-kbd
P: /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/0003:046D:C52B.0015/input/input34/event18
N: input/event18
S: input/by-id/usb-Logitech_USB_Receiver-if02-event-kbd
S: input/by-path/pci-0000:00:14.0-usb-0:2:1.2-event-kbd
E: DEVLINKS=/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-kbd /dev/input/by-path/pci-0000:00:14.0-usb-0:2:1.2-event-kbd
E: DEVNAME=/dev/input/event18
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/0003:046D:C52B.0015/input/input34/event18
E: ID_BUS=usb
E: ID_INPUT=1
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_MODEL=USB_Receiver
E: ID_MODEL_ENC=USB\x20Receiver
E: ID_MODEL_ID=c52b
E: ID_PATH=pci-0000:00:14.0-usb-0:2:1.2
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_2_1_2
E: ID_REVISION=1203
E: ID_SERIAL=Logitech_USB_Receiver
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030101:030102:030000:
E: ID_USB_INTERFACE_NUM=02
E: ID_VENDOR=Logitech
E: ID_VENDOR_ENC=Logitech
E: ID_VENDOR_ID=046d
E: KEYBOARD_KEY_70004=b  <--------
E: KEYBOARD_KEY_70005=a  <--------
E: MAJOR=13
E: MINOR=82
E: SUBSYSTEM=input
E: USEC_INITIALIZED=397136693

我尝试覆盖它

> cat /lib/udev/hwdb.d/70-keyboad.hwdb
# XXXX is the 4-digit hex uppercase vendor, and YYYY the 4-digit hex uppercase product.
# keyboard:usb:vXXXXpYYYY*
keyboard:usb:v046D*
  # Logitech keyboard is overriding the A and B keys for some reason
  KEYBOARD_KEY_70004=a
  KEYBOARD_KEY_70005=b

无济于事。

如何编写正确的匹配来覆盖它?我找不到任何有关如何编写正确匹配的文档,也无法找出哪个规则插入了“KEYBOARD_KEY”别名:\

答案1

嘟嘟嘟!我有一个蓝牙键盘,之前曾搞乱过 udev,试图使其工作,但放弃并留下了配置。

> grep  KEYBOARD_KEY_70004 /etc/udev/hwdb.d/* /lib/udev/hwdb.d/*
/etc/udev/hwdb.d/90-bluetooth-keyboard.hwdb:  KEYBOARD_KEY_70004=b

来自文档

udevadm hwdb [选项] 在 /lib/udev/hwdb.bin 中维护硬件数据库索引。

  --update
      Compile the hardware database information located in **/lib/udev/hwdb.d/**, **/etc/udev/hwdb.d/** and store it in /lib/udev/hwdb.bin. This should be done after any update to the source files; it will not be called automatically.
      The running udev daemon will detect a new database on its own and does not need to be notified about it.

但是,如果有人有关于如何编写正确匹配的文档,请指出我。

干杯

相关内容