Is there a way to detect press and hold super key?

Hi guys,
I am trying to develop feature for icon-only-task-manager. I was inspired by this https://bugs.kde.org/show_bug.cgi?id=444281 I have working prototype(it’s ugly atm https://imgur.com/a/lWjipFe ), but can’t find anywhere in the code, example of press and hold super key to activate/do something. In this case I would like to show numbering when super key is press and hold for some amount of time, and to hide numbering when super key is released.
Anybody can help?

Thanks, bad63r

For global shortcuts such as needed for this feature, you would need to use KGlobalAccel.

Except at the moment it does not have a “holding key pressed” handling.
You would need to add it to Frameworks / KGlobalAccel · GitLab and
src · master · Plasma / KGlobalAccel Daemon · GitLab backend implementation.
At least the kglobalacceld already access all key press/release.

Note that currently meta release is hooked to open kickoff menu. That would play weirdly when holding Meta would be hold. A holding shortcut of Meta + Alt might be more appropriate.

1 Like