Systemd/rules/60-keyboard.rules
David Herrmann b26e4ced91 hwdb: convert to generic input-modalias matches
There is no reason to match on usb-modaliases, if we can use the
input-modalias to achieve the same. This commit changes the
keyboard-lookups to not be restricted to USB, but pass all modaliases to
the hwdb. Furthermore, we convert all usb:* matches to input:* matches,
thus getting rid of any ambiguity if multiple usb devices are chained (or
a bluetooth device / etc. is on top).

Note that legacy keyboard:usb:* matches are still supported, but
deprecated. If possible, please use keyboard:input:* matches instead.

This is a required step to make other input devices work with
60-keyboard.hwdb. Other bus-types are often chained on usb and we want to
avoid any ambiguity here if we incorrectly match on a USB hub.
2015-03-16 12:00:46 +01:00

23 lines
788 B
Plaintext

# do not edit this file, it will be overwritten on update
ACTION=="remove", GOTO="keyboard_end"
KERNEL!="event*", GOTO="keyboard_end"
ENV{ID_INPUT_KEY}=="", GOTO="keyboard_end"
# ignore all bluetooth devices
SUBSYSTEMS=="bluetooth", GOTO="keyboard_end"
# import key mapping for input device
IMPORT{builtin}="hwdb --lookup-prefix=keyboard:", \
RUN{builtin}+="keyboard", GOTO="keyboard_end"
# import key mapping for AT keyboard from DMI data
DRIVERS=="atkbd", IMPORT{builtin}="hwdb 'keyboard:$attr{[dmi/id]modalias}'", \
RUN{builtin}+="keyboard", GOTO="keyboard_end"
# import key mapping for platform input device
KERNELS=="input*", IMPORT{builtin}="hwdb 'keyboard:name:$attr{name}:$attr{[dmi/id]modalias}'", \
RUN{builtin}+="keyboard", GOTO="keyboard_end"
LABEL="keyboard_end"