Discussion:
Need a bit of help with KEYBOARD_KEY_xx hwdb entries
Add Reply
Sam Morris
2018-04-29 15:11:32 UTC
Reply
Permalink
Raw Message
Pressing the brightness keys on my Dell Vostro 1520 results in events
coming from both the atkbd and the acpi-video input devices, resulting
in double-stepped brightness changes. Based on
I'm trying to arrange for the brightness key events for the atkbd
device in my laptop (Dell Vostro 1520) to be ignored, as the acpi-video
input device also generates them, resulting in double-stepped
brightness changes. Based on the output of libinput-debug-events:

-event0 KEYBOARD_KEY +5.62s KEY_BRIGHTNESSDOWN (224) pressed
event0 KEYBOARD_KEY +5.62s KEY_BRIGHTNESSDOWN (224) released
-event0 KEYBOARD_KEY +9.61s KEY_BRIGHTNESSUP (225) pressed
event0 KEYBOARD_KEY +9.61s KEY_BRIGHTNESSUP (225) released

I've got the following:

# Dell Vostro 1520
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDellInc.:pnVostro1520:pvr*
KEYBOARD_KEY_e0=unknown # Brightness Down, also emitted by acpi-video, ignore
KEYBOARD_KEY_e1=unknown # Brightness Up, also emitted by acpi-video, ignore

... which has applied OK:

$ /sbin/udevadm info --path=/sys/class/input/event0 | grep KEYBOARD_KEY_e[01]
E: KEYBOARD_KEY_e0=unknown
E: KEYBOARD_KEY_e1=unknown

... but the events are not ignored by Xorg, which is using libinput:

$ grep 'AT Translated' ~/.local/share/xorg/Xorg.0.log
[175652.950] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event0)
[175652.950] (**) AT Translated Set 2 keyboard: Applying InputClass "libinput keyboard catchall"
[175652.950] (II) Using input driver 'libinput' for 'AT Translated Set 2 keyboard'
[175652.954] (**) AT Translated Set 2 keyboard: always reports core events
[175652.954] (II) event0 - AT Translated Set 2 keyboard: is tagged by udev as: Keyboard
[175652.954] (II) event0 - AT Translated Set 2 keyboard: device is a keyboard
[175652.954] (II) event0 - AT Translated Set 2 keyboard: device removed
[175652.954] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id 10)
[175652.955] (II) event0 - AT Translated Set 2 keyboard: is tagged by udev as: Keyboard
[175652.957] (II) event0 - AT Translated Set 2 keyboard: device is a keyboard

I've also tried using 'reserved' instead of 'unknown' with the same
effect. So... what have I missed?

Thanks!
--
Sam Morris <https://robots.org.uk/>
CAAA AA1A CA69 A83A 892B 1855 D20B 4202 5CDA 27B9
Lennart Poettering
2018-04-30 09:55:42 UTC
Reply
Permalink
Raw Message
Post by Sam Morris
$ grep 'AT Translated' ~/.local/share/xorg/Xorg.0.log
[175652.950] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event0)
[175652.950] (**) AT Translated Set 2 keyboard: Applying InputClass "libinput keyboard catchall"
[175652.950] (II) Using input driver 'libinput' for 'AT Translated Set 2 keyboard'
[175652.954] (**) AT Translated Set 2 keyboard: always reports core events
[175652.954] (II) event0 - AT Translated Set 2 keyboard: is tagged by udev as: Keyboard
[175652.954] (II) event0 - AT Translated Set 2 keyboard: device is a keyboard
[175652.954] (II) event0 - AT Translated Set 2 keyboard: device removed
[175652.954] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id 10)
[175652.955] (II) event0 - AT Translated Set 2 keyboard: is tagged by udev as: Keyboard
[175652.957] (II) event0 - AT Translated Set 2 keyboard: device is a keyboard
I've also tried using 'reserved' instead of 'unknown' with the same
effect. So... what have I missed?
Hmm, so Peter Hutterer (the libinput maintainer) is probably the right
person to inquire about this. Either contact the libinput mailing list
about this, or maybe file a github issue against systemd and add
'@whot' as CC to it, so that Peter is in the loop. It's after all a
"bug" in the hwdb that we currently don't cover this correctly, by
some loose definition of "bug"...

Lennart
--
Lennart Poettering, Red Hat
Mantas Mikulėnas
2018-04-30 11:17:09 UTC
Reply
Permalink
Raw Message
Post by Sam Morris
Pressing the brightness keys on my Dell Vostro 1520 results in events
coming from both the atkbd and the acpi-video input devices, resulting
in double-stepped brightness changes. Based on
I'm trying to arrange for the brightness key events for the atkbd
device in my laptop (Dell Vostro 1520) to be ignored, as the acpi-video
input device also generates them, resulting in double-stepped
-event0 KEYBOARD_KEY +5.62s KEY_BRIGHTNESSDOWN (224) pressed
event0 KEYBOARD_KEY +5.62s KEY_BRIGHTNESSDOWN (224) released
-event0 KEYBOARD_KEY +9.61s KEY_BRIGHTNESSUP (225) pressed
event0 KEYBOARD_KEY +9.61s KEY_BRIGHTNESSUP (225) released
# Dell Vostro 1520
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnDellInc.:pnVostro1520:pvr*
KEYBOARD_KEY_e0=unknown # Brightness Down, also emitted by acpi-video, ignore
KEYBOARD_KEY_e1=unknown # Brightness Up, also emitted by acpi-video, ignore
$ /sbin/udevadm info --path=/sys/class/input/event0 | grep
KEYBOARD_KEY_e[01]
E: KEYBOARD_KEY_e0=unknown
E: KEYBOARD_KEY_e1=unknown
Wait, I thought the mappings are "scan code → evdev code"? 224/225 as shown
by libinput-debug-events would be the evdev codes (i.e. the mapping *result*),
not scan codes.
--
Mantas Mikulėnas
Sam Morris
2018-04-30 14:00:32 UTC
Reply
Permalink
Raw Message
Wait, I thought the mappings are "scan code → evdev code"? 224/225 as shown
by libinput-debug-events would be the evdev codes (i.e. the mapping *result*),
not scan codes.
Aah, that must be it; thanks for pointing that out!

I presume I need to use 'evtest' and use the value of the MSC_SCAN
event, e.g.:

Event: time 1525096661.175000, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004
Event: time 1525096661.175000, type 1 (EV_KEY), code 30 (KEY_A), value 1
Event: time 1525096661.175000, -------------- SYN_REPORT ------------

I'll give that a go later in the week when I have access to the laptop
again.
--
Sam Morris <https://robots.org.uk/>
CAAA AA1A CA69 A83A 892B 1855 D20B 4202 5CDA 27B9
Loading...