HP Laptop - Keyboard codes

SlowCoder

Gold Member
Gold Supporter
Joined
May 2, 2022
Messages
455
Reaction score
316
Credits
3,611
I bought my wife a HP 15-dw0046nr laptop, and installed Linux Mint Debian Edition 5.
* side note: I bought it from local trusted pawn for $150. It smelled like Cheetos.

System info:
Code:
~ $ inxi -Fnxx
System:    Host: venus Kernel: 5.10.0-15-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 Console: tty 1 DM: LightDM
           Distro: LMDE 5 Elsie base: Debian 11.2 bullseye
Machine:   Type: Laptop System: HP product: HP Laptop 15-dw0xxx v: Type1ProductConfigId serial: <superuser required>
           Chassis: type: 10 serial: <superuser required>
           Mobo: HP model: 85EF v: 36.41 serial: <superuser required> UEFI: Insyde v: F.53 date: 10/15/2021
Battery:   ID-1: BAT1 charge: 25.9 Wh condition: 37.7/41.0 Wh (92%) volts: 11.6/11.4
           model: Hewlett-Packard PABAS0241231 serial: 41167 status: Discharging
CPU:       Info: Quad Core model: Intel Core i5-8265U bits: 64 type: MT MCP arch: Kaby Lake note: check rev: C
           L2 cache: 6 MiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 28800
           Speed: 537 MHz min/max: 400/3900 MHz Core speeds (MHz): 1: 537 2: 532 3: 541 4: 594 5: 596 6: 593 7: 596
           8: 592
Graphics:  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: Hewlett-Packard driver: i915 v: kernel
           bus ID: 00:02.0 chip ID: 8086:3ea0
           Device-2: Quanta HP TrueVision HD Camera type: USB driver: uvcvideo bus ID: 1-5:2 chip ID: 0408:5365
           Display: server: X.org 1.20.11 driver: loaded: modesetting unloaded: fbdev,vesa tty: 120x50
           Message: Advanced graphics data unavailable in console. Try -G --display
Audio:     Device-1: Intel Cannon Point-LP High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel
           v: kernel bus ID: 00:1f.3 chip ID: 8086:9dc8
           Sound Server: ALSA v: k5.10.0-15-amd64
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard driver: r8169
           v: kernel port: 4000 bus ID: 01:00.0 chip ID: 10ec:8168
           IF: eno1 state: down mac: 80:e8:2c:72:c8:40
           Device-2: Realtek RTL8821CE 802.11ac PCIe Wireless Network Adapter vendor: Hewlett-Packard
           driver: rtl8821ce v: N/A port: 3000 bus ID: 02:00.0 chip ID: 10ec:c821
           IF: wlo1 state: up mac: dc:f5:05:d0:d7:bf
RAID:      Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 bus ID: 00:17.0
           chip ID: 8086.282a
Drives:    Local Storage: total: 931.51 GiB used: 42.68 GiB (4.6%)
           ID-1: /dev/sda vendor: Seagate model: ST1000LM035-1RK172 size: 931.51 GiB speed: 6.0 Gb/s
           serial: WQ905H2H temp: 31 C
Partition: ID-1: / size: 48.91 GiB used: 14.96 GiB (30.6%) fs: ext4 dev: /dev/sda2
           ID-2: /boot/efi size: 511 MiB used: 3.4 MiB (0.7%) fs: vfat dev: /dev/sda1
           ID-3: /home size: 816.9 GiB used: 27.72 GiB (3.4%) fs: ext4 dev: /dev/sda4
Swap:      ID-1: swap-1 type: file size: 8 GiB used: 0 KiB (0.0%) priority: -2 file: /swapfile
Sensors:   System Temperatures: cpu: 32.0 C mobo: 29.8 C
           Fan Speeds (RPM): N/A
Info:      Processes: 235 Uptime: 13m Memory: 7.66 GiB used: 1.66 GiB (21.7%) Init: systemd v: 247 runlevel: 5
           Compilers: gcc: 10.2.1 alt: 10 Packages: apt: 2277 Shell: Bash v: 5.1.4 running in: tty 1 inxi: 3.3.01

Works great, except ...
The problem (besides the Cheetos flavor): Brightness keys don't appear to register. I get the following system messages:
Code:
$ journalctl -f
atkbd serio0: Unknown key pressed (translated set 2, code 0xab on isa0060/serio0).
atkbd serio0: Use 'setkeycodes e02b <keycode>' to make it known.
atkbd serio0: Unknown key released (translated set 2, code 0xab on isa0060/serio0).
atkbd serio0: Use 'setkeycodes e02b <keycode>' to make it known.
---------
atkbd serio0: Unknown key pressed (translated set 2, code 0xab on isa0060/serio0).
atkbd serio0: Use 'setkeycodes e02b <keycode>' to make it known.
atkbd serio0: Unknown key released (translated set 2, code 0xab on isa0060/serio0).
atkbd serio0: Use 'setkeycodes e02b <keycode>' to make it known.
The top 4 lines are output for Fn-F2 (brightness down), the bottom 4 are output for Fn-F3 (brightness up).
Notice both keycodes are the same (e02b)? This is a known issue, apparently, otherwise I'd be concerned it's a hardware problem.

I've tried various Google-fu solutions, of the Linux boot options variety, to no avail:
Code:
GRUB_CMDLINE_LINUX="acpi_osi=\"!Windows 2012\""
and
GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor"

Some sites recommended updating BIOS, which isn't available for this system.

So, what else to try?
 


Here are the boot tweaks I've tried:
Code:
#GRUB_CMDLINE_LINUX="acpi_brightness=video"
#GRUB_CMDLINE_LINUX="acpi_backlight=native pcie_aspm=force"
#GRUB_CMDLINE_LINUX="acpi_osi=\"!Windows 2012\""
#GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor"
#GRUB_CMDLINE_LINUX="pcie_aspm=force acpi_backlight=vendor"
#GRUB_CMDLINE_LINUX="acpi_osi=\"!windows 2012\" pcie_aspm=force i8042.reset"
#GRUB_CMDLINE_LINUX="acpi_osi= pcie_aspm=force i8042.reset"

That's not so much a fix, as a workaround using xbacklight to manually set. I'm looking for a more low-level fix. As it is, both of the key report the same code, which keeps setkeycodes command from working, so I can't even map the keys to the xbacklight command.
 
UEFI: Insyde v: F.53 date: 10/15/2021
I have an older HP laptop, with Insyde F.30 UEFI. I may be way off, but can you take a look at your UEFI/BIOS settings, in System Configuration (if you have that tab)... and see if you have "Action Keys Mode".

This setting determines whether you need to use the Fn key or not when using the F1-F12 functions. On my older model, this defaults to Enabled, so pressing the Fn key is not needed. In fact, the screen brightness doesn't work if I do try to use the Fn key (unless I change it to Disabled). Mine also uses F2/F3 to control the brightness, and it works with LMDE 5.

TL;DR... Try your brightness settings F2/F3 without using the Fn key. It may work.
 
I have an older HP laptop, with Insyde F.30 UEFI. I may be way off, but can you take a look at your UEFI/BIOS settings, in System Configuration (if you have that tab)... and see if you have "Action Keys Mode".

This setting determines whether you need to use the Fn key or not when using the F1-F12 functions. On my older model, this defaults to Enabled, so pressing the Fn key is not needed. In fact, the screen brightness doesn't work if I do try to use the Fn key (unless I change it to Disabled). Mine also uses F2/F3 to control the brightness, and it works with LMDE 5.

TL;DR... Try your brightness settings F2/F3 without using the Fn key. It may work.
Yep, I tried that, thinking it might be a fluke in keycode handling, but it didn't work whether I enabled or disabled the setting.
 
Latest attempt was to boot into Fedora 36 Live USB, which uses the 5.17 kernel (vs the installed 5.10 kernel). No difference.
 
I am also have an HP computer:
System: Host: pavilion15dk0ur Kernel: 5.15.0-46-generic x86_64 bits: 64 compiler: N/A Desktop: Gnome 3.36.9 wm: gnome-shell dm: GDM3 Distro: Ubuntu 20.04.5 LTS (Focal Fossa) Machine: Type: Laptop System: HP product: HP Pavilion Gaming Laptop 15-dk0xxx
And F2 and F3 also is intended fit the brightness of monitor, but it didn't. I want to share some of my surveillances.
I have run a xev -event keyboard to check is something going when I pressed F2-F3: unexpectedly, nothing done when press them. I sure that keyboard is in working condition, 'cause on the Windows F2 and F2 is works fine. Also, I noted when I pressed a regular keys (from A to Z, from 1 to 9), xev prints a usual output with the KeyPress or KeyRelease events, for example for t:
KeyPress event, serial 28, synthetic NO, window 0x4400001, root 0x925, subw 0x0, time 429158411, (565,661), root:(651,813), state 0x10, keycode 28 (keysym 0x74, t), same_screen YES, XLookupString gives 1 bytes: (74) "t" XmbLookupString gives 1 bytes: (74) "t" XFilterEvent returns: False
But if F4-F12 keys is pressed, it prints an another type, the KeymapNotify event:
KeymapNotify event, serial 28, synthetic NO, window 0x0, keys: 37 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
and this output is the same for all F4-F12 keys. Doesn't matter if you press the key or release it. F2 and F3, as I told earlier, does not affected xev.
Unlike a SlowCoder, in my BIOS the Fn key is not mandatory in Action Keys Mode. I mean, Fn+F1-F12 acts as a F1-F12, and with no Fn the F keys acts as a media keys: manage a sound volume, a keyboard illumination or monitor brightness.
Like a SlowCoder, my F2 and F3 triggers the same signal - e02b keycode in syslog. I think this is unfitted driver for keyboard, the standard keyboard driver for linux is not implements all functions of HP vendor keyboard.

Also, I run acpi_listen. It's catch some of the media keys, such as Switch monitor mode (LINEOUT, VIDEOOUT) on F4, F6-F9, F11 (MUTE, VOLDN, VOLUP, CDPREV, CDNEXT), but F1-F3 and F5 doesn't (but besides F5, a keyboard illumination tuning, is working properly)
 
Last edited:
As a halfway workaround, you can set up keycode 224 (brightness down) or 225 (up) to the e02b keyscan:
sudo setkeycodes e02b 225.
Both F2 and F3 will set up a monitor brighter, so there is also need set up keyboard driver to differ them.
 

Staff online

Members online


Latest posts

Top