You are not logged in.
I've got Arch running on a Lenovo Ideapad 5i laptop. The keyboard has three function keys (F4, F8, and F9) which are handled separately from the keyboard (keyboard is /dev/input/event2, buttons are /dev/input/event8). The F4 and F8 do not report a scancode using showkey -s, but both report keycode 240 with showkey -k. If I run evtest /dev/input/event8, F4 shows a value of 0x13e and F8 shows 0x13f.
Using the instructions for Map scancodes to keycodes I created the file /etc/udev/hwdb.d/11-ideapad.hwdb:
evdev:input:b0019v0000p0000e0000*
KEYBOARD_KEY_13e=media
KEYBOARD_KEY_13f=battery
I then run systemd-hwdb update and udevadm trigger, then run udevadm info /dev/input/event8 | grep KEYBOARD_KEY to verify the keys are there. However, the two keys still return keycode of 240.
If it makes any difference, I'm using KDE Plasma 6 and running Wayland.
Offline
Perhaps you're missing a module; there is an ideapad_laptop kernel module which on my Lenovo is responsible for F4, F8, and F10.
Failing that, have you tried the third method on the "map scancodes to keycodes" page? I ask because a scancode of 0x... is likely to be exactly the sort that the kernel would complain about, in which case you'd need to set them with /usr/bin/setkeycodes at boot.
It's also possible to map keycode 240 to an action with a high-level keyboard utility (using hwdb/udev directly is low-level), but that's not likely what you want, since it wouldn't discriminate between F4, F8, or anything else that sends keycode 240.
Offline
Perhaps you're missing a module; there is an ideapad_laptop kernel module which on my Lenovo is responsible for F4, F8, and F10.
Failing that, have you tried the third method on the "map scancodes to keycodes" page? I ask because a scancode of 0x... is likely to be exactly the sort that the kernel would complain about, in which case you'd need to set them with /usr/bin/setkeycodes at boot.
It's also possible to map keycode 240 to an action with a high-level keyboard utility (using hwdb/udev directly is low-level), but that's not likely what you want, since it wouldn't discriminate between F4, F8, or anything else that sends keycode 240.
I discovered today that the most recent version of ideapad_laptop.c does support these keys. I patched the module, rebuilt and loaded it, and it detects them. Now I just need to figure out how to assign them to something Wayland can detect.
Offline