This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[Feature request]: Nested global keyboard shortcuts

1

Votes
1
0
Tags: feature request, shortcuts feature request, shortcuts feature request, shortcuts
(comma "," separated)
ismxy
Registered Member
Posts
3
Karma
0
Trying i3 for a while, one thing I really miss are nested keyboard shortcuts. For example, I can press Alt+M to enter media mode (could be anything), from where I can press p for play/pause, n for next, etc. Maybe a small script would be enough to add this functionality, but I have no idea how this could be done. What do you think about this?
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
ismxy wrote:Trying i3 for a while...

What exactly are you referring to? I know a car with that name, but in the context of our software not so much. Please be a tad more precise what exact application you are talking about


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
ismxy
Registered Member
Posts
3
Karma
0
I'm talking about the i3 tiling window manager (https://i3wm.org/).
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Hi!

Do you want to know how to implement this via GUI, like a little menu in system tray? Have a look at https://kdesrc-build.kde.org/ to get an idea on how to start and https://github.com/KDE/kglobalaccel to add your changes to the basic shortcut package.
Lachu
Registered Member
Posts
864
Karma
1
OS
Plasma really does not support something similar?

I can set to show Activity Panel by pressing ALT+D,ALT+A (probably this is the default shortcut).

As far, as I understood you need rather something like switchable keyboard layout, but really you cannot use existing feature, I suggest?


Lachu, proud to be a member of KDE forums since 2008-Nov.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
Lachu wrote:Plasma really does not support something similar?

You can have multiple ones since last year ⇨ https://blog.david-redondo.de/kde/2021/02/03/keys.html but afaik you cannot make a sub group with additional commands like in i3.
ALT+D,ALT+A is implemented in the plasmashell code itself and not configurable via system settings, I think. There was a bigger focus on gestures which are groupable for different active windows (see systemsettings5 — custom shortcuts).
ismxy
Registered Member
Posts
3
Karma
0
I really want to implement this, but I have no idea where to start. Can I do those changes on the system I use for everything else? How do I get this change into KDE? How should I test this? And how can I learn more about how kglobalaccel works? I have some experience with C++, but I haven't worked on such a big project.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS
I think the easiest approach would be to write a daemon or plasmoid which will be activated/focused by the first key, then listens to the keyboard and execute the statements you want to.
I'd implement dbus-handler, because a lot of plasma-stuff is available through it.

Or you could access the keyboard directly, reading the event-loop, and bypass the plasma-stuff.

Perhaps there is a developer reading this and able to help out with KGlobalAccel, as I am just playing with code in my spare time too ;)


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], Sogou [Bot]