How to "steal" key combination presses in Plasma 6?

I log my keypresses with a custom script running evtest in order to be able to have custom shortkeys for both single keys (such as F11) and key combinations (such as LinKey + A or LinKey + Enter).

While I was using Plasma 5.x, I was able to (ab)use its “custom shortcuts” feature to simply “eat” all those combinations and keys with “dummy entries” which did nothing but run some simple do-nothing command (since it couldn’t be empty), with the positive side-effect that Plasma itself and various programs currently focused didn’t do random annoying things when I pressed them (even though my script got the signals).

But now in Plasma 6.x, this feature has vanished. So now I’m forced to find another way to accomplish “stealing” the keypresses, which proves difficult to say the least.

I thought that I had found a (rather ugly) way with xmodmap, but it’s only able to disable single keys – not key combinations.

What should I do to make sure that all my custom combinations don’t ever get sent to Plasma or any program – only to my evtest daemon?

Please note that manually attempting to turn all these “helpful shortcuts” off in various programs is not feasible. They are just so many and happen everywhere, such as F1 bringing up manuals or F11 showing an unwanted panel in Dolphin or going fullscreen in Firefox, or LinKey + Enter actually making a newline in Kate when I have it focused but intend to run my hotkey only, etc.

For the moment, perhaps you can use an x11 session while investigating how other tools can/can’t do this?

I know Input Remapper supports single and key-combos, but I don’t know how it does this or what it uses under the hood. There are other tools as well.

I normally have my capslock disabled in System Settings, and I am using Input Remapper at the moment to change the actions for my cheap crap Logitech MX master knockoff mouse’s extra buttons, so I did a quick test and used that tool to remap f11 as capslock, and it did what I expected — nothing.

I did the same with ctrl-alt-f6, with the same desired effect.

So there are ways, the task would be to see how it can be scripted to your needs,

I should’ve mentioned that I do use X11 and have no plans to switch to Wayland while I have a choice due to the numerous incompatibilities, bugs and stability problems I’ve had every time I’ve tried to use Wayland.

Luckily, the input-remapper you mention is available in Debian 13’s APT, so I’ll try that out today. Hopefully it will let me “eat” those keys. But I really was hoping for Plasma itself to have something for this. It seems strange to just remove such a “core” feature.

Well, I managed to get Input Remapper running, and after not being able to do what I wanted in the GUI, I read the manual carefully and got hopeful when I read: “It is also possible to map a key to disable to stop it from doing anything.” Which I did. But after applying it, all keyboard keys no longer get sent to my evtest script; it’s as if the Input Remapper program has entirely taken over the signals… even those keys I don’t mention in my Input Remapper configuration. But looking in the list of evtest devices, I noticed two new ones:

/dev/input/event22:     input-remapper keyboard
/dev/input/event23:     input-remapper Logitech USB Keyboard forwarded

However, switching my evtest daemon to listen on either of those still doesn’t work. Input Remapper seems to truly “disable” the keys I set to “disable”, and there is nothing else to pick (such as “don’t forward to Plasma”) that I can find anywhere. It also doesn’t let me apply items with an empty “output” field. Also, in the “advanced” box, I’ve tried turning on and off the cryptic “Release input” checkbox.

In short, Input Remapper seems to not let me do what I want. If it does, I can’t figure out how, and I’m crippled until I find a solution. All my hotkeys, which I rely on entirely, are constantly interfered with in Plasma 6.

I just discovered by revisting the new “Shortcuts” settings that I can in fact add my own keys there, just like before (but in a different way)! It just didn’t understand my existing backed up blockers.khotkeys file. Re-inputting all the keys is a small price to pay for this nightmare of an issue to be solved!

This question can be disregarded now.