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

Keyboard shortcut handling for plasmoid

Tags: None
(comma "," separated)
stibi
Registered Member
Posts
1
Karma
0
Hello,
I'm working on my first plasmoid and I got into problems from very beginning :(
My goal is that the plasmoid should do something when certain keyboard shortcut is pressed.
I can see in the plasmoid configuration that there is a dialog for the shortcut configuration.
But how I can handle the event from keyboard in the plasmoid code?

I can't find any API for that :( (maybe I'm just not searching enough...).

I guess there will be some signal for this, which I can bind to some function I create?

I'm developing the plasmoid in Python, but that doesn't matter for me, I can switch to cpp if needed. But I presume that the API could be same for both, isn't?

Thanks you guys for hints!
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
While i'm not sure how you can bind to that shortcut - it sounds like you are after a global shortcut.
You can use the KGlobalAccel class to register and interact with global shortcuts - http://api.kde.org/4.x-api/kdelibs-apid ... Accel.html


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], Yahoo [Bot]