From ee6aefa09bcb38aeb01340bc99514561128f9069 Mon Sep 17 00:00:00 2001 From: Jamie Lentin Date: Tue, 9 Sep 2014 22:22:46 +0100 Subject: [PATCH] udev: Allow key mapping for bluetooth keyboards Signed-off-by: Jamie Lentin --- hwdb/60-keyboard.hwdb | 5 +++++ rules/60-keyboard.rules | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb index 0ffcb83..956459b 100644 --- a/hwdb/60-keyboard.hwdb +++ b/hwdb/60-keyboard.hwdb @@ -17,6 +17,11 @@ # XXXX is the 4-digit hex uppercase vendor, and YYYY # the 4-digit hex uppercase product. # +# - Bluetooth keyboards identified by the HID kernel modalias: +# keyboard:hid:b*5g*v*XXXXp*YYYY +# XXXX is the hex uppercase vendor, and YYYY the hex uppercase +# product. +# # - AT keyboard DMI data matches: # keyboard:dmi:bvn*:bvr*:bd*:svn:pn:pvr* # and are the firmware-provided strings diff --git a/rules/60-keyboard.rules b/rules/60-keyboard.rules index 22f71e7..2bf1299 100644 --- a/rules/60-keyboard.rules +++ b/rules/60-keyboard.rules @@ -4,8 +4,9 @@ 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" +# Map BT devices via. HID modalias +SUBSYSTEMS=="bluetooth", IMPORT{builtin}="hwdb --subsystem=hid --lookup-prefix=keyboard:", \ + RUN{builtin}+="keyboard", GOTO="keyboard_end" # import key mapping for USB device SUBSYSTEMS=="usb", IMPORT{builtin}="hwdb --subsystem=usb --lookup-prefix=keyboard:", \ -- 2.1.0.rc1