Bug 216824
Summary: | Some laptop hotkeys don't work | ||
---|---|---|---|
Product: | Drivers | Reporter: | André Barata (andretiagob) |
Component: | Platform_x86 | Assignee: | drivers_platform_x86 (drivers_platform_x86) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | jwrdegoede |
Priority: | P1 | ||
Hardware: | Intel | ||
OS: | Linux | ||
Kernel Version: | 6.0 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
Laptop hotkeys
evtest smesg 60-keyboard.hwdb key led key led 2 |
Description
André Barata
2022-12-20 22:32:22 UTC
Created attachment 303437 [details]
evtest
Created attachment 303438 [details]
smesg
3 files annexed: image, evtest.txt and dmseg.txt 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. Created attachment 303443 [details]
60-keyboard.hwdb
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? (In reply to Hans de Goede from comment #4) > 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. 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 Oh yes, turning the camera switch off the hotkey does nothing. I guess it physicaly disconects the camera. 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. 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). Created attachment 303445 [details]
key led
Created attachment 303446 [details]
key led 2
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 (In reply to Hans de Goede from comment #13) > 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 Yeah if i FN + Escape tu led turns on :) Well, what mattered was the hotkeys themselves and they are working now! Thank you Hans! 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! 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 ? (In reply to Hans de Goede from comment #16) > 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 ? 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 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. 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. (In reply to Hans de Goede from comment #19) > 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! :) Should i create a pull request in here? https://github.com/systemd/systemd/pull/25824 cheers Great I have submitted a pull-request adding this here: https://github.com/systemd/systemd/pull/27017 I did not see your earlier comment, no need to create a pull-request since I just already did so myself :) (In reply to Hans de Goede from comment #23) > I did not see your earlier comment, no need to create a pull-request since I > just already did so myself :) Thank you Hans!! |