New: Some laptop hotkeys don't work
https://bugzilla.kernel.org/show_bug.cgi?id=216824
Bug ID: 216824
Summary: Some laptop hotkeys don't work
Product: Drivers
Version: 2.5
Kernel Version: 6.0
Hardware: Intel
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Platform_x86
Assignee: [email protected]
Reporter: [email protected]
Regression: No
Created attachment 303436
--> https://bugzilla.kernel.org/attachment.cgi?id=303436&action=edit
Laptop hotkeys
This bug was filed at the request of Hans de Goede, he as been super helpful:
https://gitlab.freedesktop.org/libinput/libinput/-/issues/822
I have a couple of hotkeys on my MSI Summit E16 Flip laptop that don't work. I attached a picture with the keys in question.
Keys number in the picture:
1. This button doesn't work: mute/unmute the microfone;
2. This button works: enable/disable webcam. There's also a physical switch on the side of the laptop that enables/disables the webcam and it also works;
3. This button doesn't work: changes between power modes on Windows using the provided MSI app MSIControl Center Pro;
4. This button doesn't work: rotate the screen 45º/90ª/180ª.
I also booted with wmi.debug_dump_wdg=1 and wmi.debug_event=1 on the kernel commandline to check if there was any events.
I did the sudo evtest test and the hotkeys in question registered. I selected number 3 in the list (see evtest.txt).
These are the events of the hotkeys in question:
Hotkey number 1 Microphone:
Event: time 1671569327.276408, type 4 (EV_MSC), code 4 (MSC_SCAN), value f1
Event: time 1671569327.276408, -------------- SYN_REPORT ------------
Event: time 1671569327.349220, type 4 (EV_MSC), code 4 (MSC_SCAN), value f1
Hotkey number 2 Camera:
Event: time 1671569327.656812, type 4 (EV_MSC), code 4 (MSC_SCAN), value ee
Event: time 1671569327.656812, type 1 (EV_KEY), code 212 (KEY_CAMERA), value 1
Event: time 1671569327.656812, -------------- SYN_REPORT ------------
Event: time 1671569327.729626, type 4 (EV_MSC), code 4 (MSC_SCAN), value ee
Event: time 1671569327.729626, type 1 (EV_KEY), code 212 (KEY_CAMERA), value 0
(Note, ignore this one since the key actually works)
Hotkey number 3 Power Mode:
Event: time 1671569328.108543, type 4 (EV_MSC), code 4 (MSC_SCAN), value 91
Event: time 1671569328.108543, -------------- SYN_REPORT ------------
Event: time 1671569328.110873, type 4 (EV_MSC), code 4 (MSC_SCAN), value 91
Hotkey number 4 Screen Rotation:
Event: time 1671569329.374406, type 4 (EV_MSC), code 4 (MSC_SCAN), value f2
Event: time 1671569329.374406, -------------- SYN_REPORT ------------
Event: time 1671569329.446527, type 4 (EV_MSC), code 4 (MSC_SCAN), value f2
MSI Summit E16 Flip (A12UCT model) Alder Lake generation OS Fedora 37
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel: 6.0.13
Wayland
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #1 from André Barata ([email protected]) --- Created attachment 303437
--> https://bugzilla.kernel.org/attachment.cgi?id=303437&action=edit
evtest
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #2 from André Barata ([email protected]) --- Created attachment 303438
--> https://bugzilla.kernel.org/attachment.cgi?id=303438&action=edit
smesg
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #3 from André Barata ([email protected]) --- 3 files annexed: image, evtest.txt and dmseg.txt
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
Hans de Goede ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected] | |g
--- Comment #4 from Hans de Goede ([email protected]) --- Thank you for the bug report.
Getting the 3 keys which don't send any events to work should be a matter of adding mappings for the MSI custom atkbd scancodes for these.
I'm going to attach a 60-keyboard.hwdb file here. Please copy this file to /etc/udev/hwdb.d and then run:
sudo systemd-hwdb update
sudo udevadm trigger /dev/input/event*
After this run "sudo evtest" again and select the "AT Translated Set 2 keyboard" again. Now all 4 keys should generate events.
And hopefully your desktop-environment will also respond to these events.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #5 from Hans de Goede ([email protected]) --- Created attachment 303443
--> https://bugzilla.kernel.org/attachment.cgi?id=303443&action=edit
60-keyboard.hwdb
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #6 from Hans de Goede ([email protected]) --- About the camera on/off hotkey, when I asked you to see if there are any changes in evtest when toggling the camera on/off I meant any changes in the output of evtest for input3 / the "AT Translated Set 2 keyboard" input device.
I expect there won't be any changes there, which would be unfortunate because it would be nice if we could send different events for camera on vs camera off.
Talking about the camera, how does Fn + F6 work with the slider/switch on the side? I guess that if you turn of the camera with the slider that then Fn + F6 simply does not do anything? IOW the slider overrides the Fn + F6 setting when the slider is in the camera-off position?
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #7 from André Barata ([email protected]) --- (In reply to Hans de Goede from comment #4)
Quoted 8 lines
Thank you for the bug report.
Getting the 3 keys which don't send any events to work should be a matter of adding mappings for the MSI custom atkbd scancodes for these.
I'm going to attach a 60-keyboard.hwdb file here. Please copy this file to
/etc/udev/hwdb.dand then run:
Quoted 7 lines
sudo systemd-hwdb update
sudo udevadm trigger/dev/input/event*After this run "sudo evtest" again and select the "AT Translated Set 2 keyboard" again. Now all 4 keys should generate events.
And hopefully your desktop-environment will also respond to these events.
Thank you for responding!
So i did those steps but the desktop environment didn't respond and nothing happened (example: mute/unmute mic).
evtest showed the events though
Related to the camera, you are right the output is always the same when pressing the hotkey:
vent: time 1671624629.967592, type 4 (EV_MSC), code 4 (MSC_SCAN), value ee
Event: time 1671624629.967592, type 1 (EV_KEY), code 212 (KEY_CAMERA), value 1
Event: time 1671624629.967592, -------------- SYN_REPORT ------------
Event: time 1671624630.042611, type 4 (EV_MSC), code 4 (MSC_SCAN), value ee
Event: time 1671624630.042611, type 1 (EV_KEY), code 212 (KEY_CAMERA), value 0
Using the switch on the side of the keyboard gives me this:
Event: time 1671624717.066109, type 4 (EV_MSC), code 4 (MSC_SCAN), value d9
Event: time 1671624717.066109, -------------- SYN_REPORT ------------
Event: time 1671624717.068528, type 4 (EV_MSC), code 4 (MSC_SCAN), value d9
Event: time 1671624717.068528, -------------- SYN_REPORT ------------
Event: time 1671624718.487656, type 4 (EV_MSC), code 4 (MSC_SCAN), value ee
Event: time 1671624718.487656, type 1 (EV_KEY), code 212 (KEY_CAMERA), value 1
Event: time 1671624718.487656, -------------- SYN_REPORT ------------
Event: time 1671624718.490199, type 4 (EV_MSC), code 4 (MSC_SCAN), value ee
Event: time 1671624718.490199, type 1 (EV_KEY), code 212 (KEY_CAMERA), value 0
Off: d9, On: value 1 and 0
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #8 from André Barata ([email protected]) --- Oh yes, turning the camera switch off the hotkey does nothing. I guess it physicaly disconects the camera.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #9 from André Barata ([email protected]) --- EDIT:
Restarted the computer and some of the hotkeys started working!
The microphone hotkey (number 1 in the image) works now. The hotkey number 2 also works, it opens up system settings.
The screen rotation hotkey does nothing.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #10 from André Barata ([email protected]) --- I found out that the rotation screen key now also works but it's not associated with any keyboard shortcut in system settings.
So to summarize, hotkeys that now work: 1. Mute/Unmute Microphone, 2. Camera On/Off (KDE doesn't notify the change), 3. Opens up System Settings (as a keyboard shortcut), 4. Screen Rotation Hotkey (Nothing happens because it's probably not associated with any keyboard shortcut).
So i think they are all working now Hans!
Just noticed something else (it's not that important). Some of the hotkeys have a led that doesn't turn on when i press them (see the led.jpg and led 2.jpg images).
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #11 from André Barata ([email protected]) --- Created attachment 303445
--> https://bugzilla.kernel.org/attachment.cgi?id=303445&action=edit
key led
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #12 from André Barata ([email protected]) --- Created attachment 303446
--> https://bugzilla.kernel.org/attachment.cgi?id=303446&action=edit
key led 2
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
Hans de Goede ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |CODE_FIX--- Comment #13 from Hans de Goede ([email protected]) --- Good to hear that the hotkeys work now.
As for the mic/speaker mute LEDs, those are tricky. They can be either attached to the embedded-controller and then we would need support to register them under /sys/class/leds with their default triggers setup correctly, after which the kernel's HDA code shoould control them for us.
Or they may be directly connected to some GPIOs on the HDA part of the main SoC or on the codec.
And the Fn-lock LED typically just works automatically (controller by the EC) if you toggle the Fn-lock by pressing Fn + escape? Although sometimes it too needs to be controller in software.
Figuring out the LEDs really requires someone with significant hw-enablement experience to actually have the laptop in their hands and then they will hopefully be able to figure things out.
I have submitted the fixes for the hotkeys upstream here:
https://github.com/systemd/systemd/pull/25824
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #14 from André Barata ([email protected]) --- (In reply to Hans de Goede from comment #13)
Quoted 14 lines
Good to hear that the hotkeys work now.
As for the mic/speaker mute LEDs, those are tricky. They can be either attached to the embedded-controller and then we would need support to register them under
/sys/class/ledswith their default triggers setup correctly, after which the kernel's HDA code shoould control them for us.Or they may be directly connected to some GPIOs on the HDA part of the main SoC or on the codec.
And the Fn-lock LED typically just works automatically (controller by the EC) if you toggle the Fn-lock by pressing Fn + escape? Although sometimes it too needs to be controller in software.
Quoted 6 lines
Figuring out the LEDs really requires someone with significant hw-enablement experience to actually have the laptop in their hands and then they will hopefully be able to figure things out.
I have submitted the fixes for the hotkeys upstream here:
https://github.com/systemd/systemd/pull/25824
Yeah if i FN + Escape tu led turns on :)
Well, what mattered was the hotkeys themselves and they are working now!
Thank you Hans!
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #15 from André Barata ([email protected]) --- Hi hans, sorry for bringing this issue again.
Recently I switched desktop environments, specifically Fedora 37 Gnome from KDE. Since the 37 version of Fedora is using an older version of systemd i had to install the patch you provided here and the function keys are working (Fedora 38 has the latest systemd version with the patch included).
So the strange thing is, the disable/enable the touchpad function key F4 stopped working in Gnome for some reason.
evtest detects the input but it doesn't do anything in gnome:
Event: time 1679493260.452112, -------------- SYN_REPORT ------------
Event: time 1679493265.334443, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1679493265.334443, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1679493265.334443, -------------- SYN_REPORT ------------
Event: time 1679493265.336519, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1679493265.336519, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1
Event: time 1679493265.336519, -------------- SYN_REPORT ------------
Event: time 1679493265.337277, type 4 (EV_MSC), code 4 (MSC_SCAN), value 76
Event: time 1679493265.337277, type 1 (EV_KEY), code 85 (KEY_ZENKAKUHANKAKU), value 1
Event: time 1679493265.337277, -------------- SYN_REPORT ------------
Event: time 1679493265.339611, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1679493265.339611, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1679493265.339611, -------------- SYN_REPORT ------------
Event: time 1679493265.342147, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1679493265.342147, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
Event: time 1679493265.342147, -------------- SYN_REPORT ------------
Event: time 1679493265.343741, type 4 (EV_MSC), code 4 (MSC_SCAN), value 76
Event: time 1679493265.343741, type 1 (EV_KEY), code 85 (KEY_ZENKAKUHANKAKU), value 0
Event: time 1679493265.343741, -------------- SYN_REPORT ------------
How can i had this key to the patch you created for systemd here:
https://github.com/systemd/systemd/pull/25824
Thank you Hans!
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #16 from Hans de Goede ([email protected]) --- That is weird.
You could try adding the following line to the list MSI keys in hwdb:
KEYBOARD_KEY_55=f21
But as the evtest output shows scancode 85 / 0x55 is normally used for a key found on some Japanese keyboards and the Fn + F4 keypress is not just sending 0x55 it is sending windows-key + ctrl + 0x55 .
You say this did work under KDE ?
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #17 from André Barata ([email protected]) --- (In reply to Hans de Goede from comment #16)
Quoted 11 lines
That is weird.
You could try adding the following line to the list MSI keys in hwdb:
KEYBOARD_KEY_55=f21
But as the evtest output shows scancode 85 /
0x55is normally used for a key found on some Japanese keyboards and the Fn + F4 keypress is not just sending0x55it is sending windows-key + ctrl +0x55.You say this did work under KDE ?
Thanks for replying Hans!
Yes, it the shortcut worked on KDE but not in Gnome for some reason.
I updated the 60-keyboard.hwdb with the KEYBOARD_KEY_55=f21 line in the MSI section.
Then i did:
sudo systemd-hwdb update
sudo udevadm trigger /dev/input/event*
It still does nothing
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #18 from André Barata ([email protected]) --- I'am mainly using that key to turn off the touchpad when i'm using the laptop in tablet mode since it doesn't turn it off in that mode.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #19 from Hans de Goede ([email protected]) --- Ugh, I got it wrong, the new line should be:
KEYBOARD_KEY_76=f21
please give that a try I expect it will fix things.
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #20 from André Barata ([email protected]) --- (In reply to Hans de Goede from comment #19)
Quoted 5 lines
Ugh, I got it wrong, the new line should be:
KEYBOARD_KEY_76=f21
please give that a try I expect it will fix things.
Yep it's working now!
:)
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #21 from André Barata ([email protected]) --- Should i create a pull request in here?
https://github.com/systemd/systemd/pull/25824
cheers
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
Hans de Goede ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|CODE_FIX |------ Comment #22 from Hans de Goede ([email protected]) --- Great I have submitted a pull-request adding this here:
https://github.com/systemd/systemd/pull/27017
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #23 from Hans de Goede ([email protected]) --- I did not see your earlier comment, no need to create a pull-request since I just already did so myself :)
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
Hans de Goede ([email protected]) changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution|--- |CODE_FIXSignature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.
[Bug 216824] Some laptop hotkeys don't work
In reply to [email protected]https://bugzilla.kernel.org/show_bug.cgi?id=216824
--- Comment #24 from André Barata ([email protected]) --- (In reply to Hans de Goede from comment #23)
Quoted 2 lines
I did not see your earlier comment, no need to create a pull-request since I just already did so myself :)
Thank you Hans!!
Signature · 4 lines
You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.