Bug 508458 - Selective_screenshot key on some Thinkpads is not recognized
Summary: Selective_screenshot key on some Thinkpads is not recognized
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: input (other bugs)
Version First Reported In: 6.4.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-19 10:52 UTC by tomashnyk
Modified: 2025-09-11 12:22 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
the key in question (2.13 MB, image/jpeg)
2025-08-19 10:52 UTC, tomashnyk
Details
screenshot (538.25 KB, image/png)
2025-08-19 13:52 UTC, Patrick Silva
Details
picture (430.99 KB, image/jpeg)
2025-08-19 14:10 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tomashnyk 2025-08-19 10:52:45 UTC
Created attachment 184238 [details]
the key in question

I have Lenovo Thinkpad X1 Extreme Gen 2 and it has a "Selective screenshot" under FN+PrtSc":

It is recognized by the kernel:

sudo libinput debug-events
 event7   KEYBOARD_KEY                 +0.000s  KEY_SELECTIVE_SCREENSHOT (634) pressed
 event7   KEYBOARD_KEY                 +0.000s  KEY_SELECTIVE_SCREENSHOT (634) released

But Plasma is blind to it. It would be nice if it were not. I tried to smuggle the request to add it here: https://invent.kde.org/plasma/kwin/-/merge_requests/7892 but was told to open a new bug report. So this is technically analogous bug to https://bugs.kde.org/show_bug.cgi?id=500651 and so possibly a duplicate of 
https://bugs.kde.org/show_bug.cgi?id=475574 .


Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.15.9-201.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × Intel® Core™ i9-9880H CPU @ 2.30GHz
Memory: 64 GiB of RAM (62,5 GiB usable)
Graphics Processor 1: Intel® UHD Graphics 630
Graphics Processor 2: NVIDIA GeForce GTX 1650 with Max-Q Design
Manufacturer: LENOVO
Product Name: 20QVS0FP00
System Version: ThinkPad X1 Extreme 2nd
Comment 1 Patrick Silva 2025-08-19 12:04:44 UTC
I use a different Lenovo laptop with a key used to the same purpose, The key does not activate the region screenshot mode by default, but I can set it manually in Shortcuts KCM,
Comment 2 tomashnyk 2025-08-19 13:39:23 UTC
How does that key identify itself with libinput debug-events? And in the KDE dialog that assigns the shortcuts? Are you by any chance using X11?
Comment 3 Patrick Silva 2025-08-19 13:52:52 UTC
Created attachment 184255 [details]
screenshot

As we can see in the attached screenshot, the key identifies itself as "Cut" in Shortcuts KCM, I use Wayland.

libinput-debug-events output:
-event5   KEYBOARD_KEY                 +0.000s  KEY_CUT (137) pressed
 event5   KEYBOARD_KEY                 +0.000s  KEY_CUT (137) released
Comment 4 tomashnyk 2025-08-19 13:57:40 UTC
Aha, interesting, that is a different keycode (137 against 634). Where and how does it appear on the keyboard, or what si your Laptop model?
Comment 5 Patrick Silva 2025-08-19 14:10:48 UTC
Created attachment 184259 [details]
picture

laptop model is "system version" seen in the attached screenshot. I'm attaching a picture showing my key.
Comment 6 tomashnyk 2025-08-19 17:54:01 UTC
I think your key is actually supposed to be selective_screenshot and is mislabeled. See https://support.lenovo.com/au/en/documentation/SG10220/ref_hotkey_icons?language=en

For the icon that is on your keyboard, it says:

"Opens the Snipping tool. (Windows operating systems)"

Cut is supposed to be equivalent to CTRL+X.

Now I dug into this for my laptop when I thought the problem was deeper down so I think the culprit is line 1331: 

https://github.com/torvalds/linux/blob/master/drivers/platform/x86/lenovo/ideapad-laptop.c

If you change "KEY_CUT" to "KEY_SELECTIVE_SCREENSHOT" and compile your own kernel, hopefully you would see selective screenshot. That would make the key unusable out of the box but would be actually correct. If so, you can submit a patch to kernel and be a kernel developer, I guess :-D (I have never done this and I am not 100 % sure this one liner is enough of a fix but I hope it is).

BTW: the key can be made usable by using software like https://github.com/samvel1024/kbct or https://github.com/rvaiya/keyd where you assign "selective_screenshot" to something like "prog4" and then that shows up in Plasma, until this underlying bug is resolved.
Comment 7 tomashnyk 2025-08-19 19:35:50 UTC
@Nate Graham: Should not this bug https://bugs.kde.org/show_bug.cgi?id=475574 be then filled against kwin too? I think my bug and that bug are analogous (maybe to the point of being duplicates, not sure).
Comment 8 Nate Graham 2025-08-19 19:50:05 UTC
Yeah, I'll move that there too.
Comment 9 tomashnyk 2025-09-11 12:22:46 UTC
(In reply to tomashnyk from comment #6)
> If you change "KEY_CUT" to "KEY_SELECTIVE_SCREENSHOT" and compile your own
> kernel, hopefully you would see selective screenshot. That would make the
> key unusable out of the box but would be actually correct. If so, you can
> submit a patch to kernel and be a kernel developer, I guess :-D (I have
> never done this and I am not 100 % sure this one liner is enough of a fix
> but I hope it is).

I reported it to the kernel bugzilla, let's see what happens with that: https://bugzilla.kernel.org/show_bug.cgi?id=220566