How do you write udev rules for a built-in keyboard?

Since asking my original question on udev keyboard remapping rules (viewed 6K times on askbot in 6 years!), I’m again stumped by the task of remapping my caps lock key to backspace on a new laptop.

This rule worked on my old laptop, added to 90-custom-keyboard.hwdb in /usr/lib/udev/hwdb.d/:

keyboard:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*
 KEYBOARD_KEY_3a=backspace
 KEYBOARD_KEY_70039=backspace

I then update via udevadm hwdb --update

But it no longer works on the new machine. Presumably the ID string is different, but I can’t find anything listed in udevadm info -a /dev/input/event3 that gives me an identifiable string to write a new rule for the built-in keyboard. All my attempts at writing generic rules to target any keyboard plugged in has also failed:

evdev:input:* # doesn't work
keyboard:usb:v*p* # doesn't work. Presumably the built-in keyboard isn't USB

Rules written with lsusb -v strings are fine, of course:

# Microsoft Sculpt Ergo Keyboard
evdev:input:b0003v045Ep07A5*
 KEYBOARD_KEY_3a=backspace
 KEYBOARD_KEY_70039=backspace

What should I examine to find a udev-friendly string to write a rule targeting a built-in keyboard? I can’t unplug it to watch /var/messages, after all. :slight_smile: