Discussion:
udev hwdb add unknown button
Add Reply
Floris
2017-06-09 08:23:46 UTC
Reply
Permalink
Raw Message
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?

Floris


[1] https://www.asus.com/Laptops/R2E/
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/drivers/platform/x86/asus-laptop.c?h=v4.9.30
Lennart Poettering
2017-06-16 07:32:09 UTC
Reply
Permalink
Raw Message
On Fri, 09.06.17 10:23, Floris (***@dds.nl) wrote:
1;4602;0c
Post by Floris
I have an older ASUS R2E UMPC[1], which has a couple of media buttons. One
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
...
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
Loading...