1

I've got a new notebook HP Omen 15, manufactured in 2020. I has Calculator key, and I cannot get it launching calculator in Ubuntu 20.04.

When I press Calculator key, nothing happens. I also cannot assign a shortcut to that key in the respective configuration program from the desktop environment. I've tried KDE with Plasma and Gnome shell (I suppose it is launched if I choose "Ubuntu" session on login screen of a display manager). Those programs invite "Press a desired key" but don't see Calculator key presses.

I've tried debugging situation with xev and showkey utilities.

If I run xev and press Calculator I see insanely many messages about pressing and releasing XF86Calculator key:

...
KeyRelease event, serial 42, synthetic NO, window 0x3e00001,
root 0x29e, subw 0x0, time 52918, (151,-96), root:(151,806),
state 0x14, keycode 148 (keysym 0x1008ff1d, XF86Calculator), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 42, synthetic NO, window 0x3e00001,
root 0x29e, subw 0x0, time 52918, (151,-96), root:(151,806),
state 0x14, keycode 148 (keysym 0x1008ff1d, XF86Calculator), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 42, synthetic NO, window 0x3e00001,
root 0x29e, subw 0x0, time 52958, (151,-96), root:(151,806),
state 0x14, keycode 148 (keysym 0x1008ff1d, XF86Calculator), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

KeyPress event, serial 42, synthetic NO, window 0x3e00001,
root 0x29e, subw 0x0, time 52958, (151,-96), root:(151,806),
state 0x14, keycode 148 (keysym 0x1008ff1d, XF86Calculator), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 42, synthetic NO, window 0x3e00001,
root 0x29e, subw 0x0, time 52999, (151,-96), root:(151,806),
state 0x14, keycode 148 (keysym 0x1008ff1d, XF86Calculator), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
...

Then I press Ctrl-C to stop it. If I run xev again, it doesn't show any events on Calculator key. If I run dmesg, it shows messages like [ 5685.955273] kauditd_printk_skb: 46 callbacks suppressed. Probably this key still generates press-release events, but the kernel suppresses them.

Probably this is the reason of the bug.

If I run showkey, it always shows scan codes and key codes, if I press Calculator key:

$ sudo showkey -s
kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
0x9c
0xe0 0x21
0x1d
^Ccaught signal 2, cleaning up...
0xe0 0x21
$ sudo showkey -k
kb mode was ?UNKNOWN?
[ if you are trying this under X, it might not work
since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
keycode  28 release
keycode 140 press
keycode  29 press
^Ccaught signal 2, cleaning up...

Overall, it looks like that key is a normal media key that is correctly mapped to XF86Calculator.

So, could you give me any clues how to get it working?

I am ready to provide any additional information about my notebook and OS.

I also think that I could try to fix that bug myself. However, currently I have no idea which module to debug.

Update Have found that logging in and out sometimes restores Calculator key. For example, if I run KDE Plasma, press Calculator key, then log out and run Ubuntu on Wayland, then I can lauch calculator once more.

Update2 Ubuntu hotkeys troubleshooting wiki page contains description of the case that seems to be exactly mine. Case 4.b - "if there are too many keypress events then you need to determine where they are being duplicated." However, that's all. So, I'd be grateful for any clues on how to determine that.

Update3 I've tried two times to reach Christopher Peñalver, author of that wiki page, however, haven't received any answer to my mails. Digging further, I've found that the issue could be in udev rules for my keyboard. Have submitted bug report to Launchpad: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1929345

1 Answer 1

1

Finally it has been fixed! Thanks to someone on Github!

The issue was in udev database, PR fixing it is merged, hopefully, it will work after one of next updates.

Solution is here

https://github.com/pelrun/hp-omen-linux-module/issues/9#issuecomment-936474113

One needs to add following lines to the file /usr/lib/udev/hwdb.d/60-keyboard.hwdb

# HP Omen 15
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP:pnOMENLaptop15*:pvr*
 KEYBOARD_KEY_a1=!calc

Update

Better solution until fresh version of HWDB appears in the packages is to put those lines in the file /etc/udev/hwdb.d/70-keyboard.hwdb

Then run sudo systemd-hwdb update

These lines have been included in systemd v250.

Currently (05 Jan 2022) version of systemd on my KUbuntu 20.04 is 245.

Update2

03 Jan 2023, package udev, version 249.11, includes that line.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .