[systemd-devel] udev hwdb add unknown button
Lennart Poettering
lennart at poettering.net
Fri Jun 16 07:32:09 UTC 2017
On Fri, 09.06.17 10:23, Floris (jkfloris at dds.nl) wrote:
1;4602;0c
> I have an older ASUS R2E UMPC[1], which has a couple of media buttons. One
> button isn't recognized and print:
>
> asus_laptop: Unknown key 9a pressed
>
> I tried to add this button with an udev hwdb rule in
> /etc/udev/hwdb.d/99-keyboard.hwdb
>
> evdev:name:Asus Laptop extra buttons:dmi:bvn*:bvr*:bd*:svnASUS:pn*pvr*
> KEYBOARD_KEY_95=keyboard <-- This one is added for testing purposes
> KEYBOARD_KEY_9a=screen
>
>
> after an udevadm update and trigger, udevadm info /dev/input/event5 reports
> the buttons:
> ...
> E: ID_PATH_TAG=platform-asus_laptop
> E: KEYBOARD_KEY_6b=f21 <-- This one is a default udev hwdb rule
> E: KEYBOARD_KEY_95=keybaord
> E: KEYBOARD_KEY_9a=screen
> E: LIBINPUT_DEVICE_GROUP=19/0/0/0:asus_laptop
> ...
>
> So far everything works as expected, but evtest doesn't show the remap of
> the 9a key
> ...
> type 4 (EV_MSC), code 4 (MSC_SCAN), value 95
> type 1 (EV_KEY), code 374 (KEY_KEYBOARD), value 1 <-- This one is modified
> as expected
> ...
> type 4 (EV_MSC), code 4 (MSC_SCAN), value 9a
> type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1 <-- Why isn't this one
> modified?
> ...
>
> Only after adding {KE_KEY, 0x9a, { KEY_SCREEN } }, to asus-laptop.c line 355
> [2] and rebuild the kernel module, I am able to remap and use the media
> button on the laptop.
>
> Is this a flaw in the kernel module or in udev?
Not all input devices permit overriding the scancode mappings, and
maybe your laptop driver is one of them?
Other than that, the only thing I can suggest is checking whether
issuing the scancode redifinition ioctls directly without udev's
involvement works. Not sure which tool to use for that, but I am sure
there's one.
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list