Skip to contentSkip to conversation

platform/x86: ideapad-laptop: Add PrintScreen key on ThinkBook 14 G8+ IPH

PATCH In review Zekai Xie 2 participants 2 messages Sep 29

Subsystems (3)
lore
Share & tools
lore

Zekai Xie

author
#0 lore raw

PATCH 1/1 platform/x86: ideapad-laptop: Add PrintScreen key on ThinkBook 14 G8+ IPH

The Fn+F11 (PrintScreen) key on the Lenovo ThinkBook 14 G8+ IPH (21VG) reports WMI scancode 0x48 (0x148 with the WMI key bit set), which has no entry in ideapad_keymap[], so userspace only receives KEY_UNKNOWN:

Event: type 4 (EV_MSC), code 4 (MSC_SCAN), value 148
Event: type 1 (EV_KEY), code 240 (KEY_UNKNOWN), value 1

Map it to KEY_SYSRQ so the key produces the Print keysym as labelled.

Assisted-by LLM
---
 drivers/platform/x86/lenovo/ideapad-laptop.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/x86/lenovo/ideapad-laptop.c +2 -0
index 8213524..4cae65c 100644
@@ -1364,6 +1364,8 @@ static const struct key_entry ideapad_keymap[] = {
 	{ KE_KEY,   0x2d | IDEAPAD_WMI_KEY, { KEY_SELECTIVE_SCREENSHOT } },
 	{ KE_KEY,   0x29 | IDEAPAD_WMI_KEY, { KEY_TOUCHPAD_TOGGLE } },
 	{ KE_KEY,   0x2a | IDEAPAD_WMI_KEY, { KEY_ROOT_MENU } },
+	/* PrintScreen (Fn+F11) on ThinkBook 14 G8+ IPH (21VG) */
+	{ KE_KEY,   0x48 | IDEAPAD_WMI_KEY, { KEY_SYSRQ } },
 
 	{ KE_END },
 };
Signature · 1 line
2.55.0
#1 lore raw

Hi Zekai,

Note that scancode 0x148 is already mapped in mainline: see commit bc39af8c2c43 ("platform/x86: ideapad-laptop: Map Smart Connect hotkey to KEY_LINK_PHONE"). Your patch seems to be based on an older tree.

That commit came from my two 2025 machines, a Yoga Pro 7 14ASP10 and a Legion Pro 7 16AFR10H. On both, the F11 key shows a symbol with a laptop, a tablet and a smartphone, and the user manual says it starts the Lenovo Smart Connect app, so the event is mapped to KEY_LINK_PHONE.

I had a look at the ThinkBook 14 G8 user guide (I could not find the G8+ IPH variant specifically, though), and there F10 is the screenshot selection tool, while F11 carries the same laptop/tablet/smartphone symbol as on my machines.
Since your commit message describes the key as Fn+F11, I suspect the event you recorded actually comes from the Smart Connect key rather than from the screenshot selection tool key, in which case KEY_LINK_PHONE is already what mainline reports for it.

In any case, if you do end up mapping a PrintScreen key in this driver, note that KEY_SYSRQ is the magic SysRq key rather than a screenshot key; KEY_PRINT, or KEY_SELECTIVE_SCREENSHOT as used for 0x04 and 0x2d if the key opens a snipping tool, would seem more appropriate.

Best regards,
Marco