![]() Registered Member ![]()
|
Hi all,
I see that each plasmoid has a shortcut configuration page where it is possible to assign a global shortcut. I want to use this shortcut to let my plasmoid do something. By default this shortcut should just bring the focus on the widget, even though none of the plasmoids I've tested do this. Lancelot instead uses this shortcut to show the menu. I've tried to search in the code of lancelot, but I haven't find where it set this global shortcut. (Lancelot also provide a specific global shortcuts configuration page, but it's not want I need). I've done this in my plasmoid (in the constructor):
but nothing happens when I trigger the shortcut. Do anyone know what I'm missing? |
![]() Registered Member ![]()
|
Actually the default behaviour of the global shortcut of bringing the focus to the plasmoid, can be see in action on the plasmoids on the panel; in fact when the global shortcut is triggered the plasmoid shows the extender. So also in the case of lancelot this is just the default behaviour, and no specific code has been written.
|
![]() Administrator ![]()
|
Please see http://api.kde.org/4.x-api/kdelibs-apid ... tml#l01556
In your constructor, it is not necessary for you to setup an action to handle the global shortcut assigned to your applet - this is done for you by Plasma::Applet. All you need to do is connect to the activate() signal which your applet will be sent.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Perfect one-line-solution.
Actually in the Plasma Applet API in the documentation of the activate() signal, it's explicitly written that it's emitted when the global shortcut is activated. But I've completely missed that line. Thanks. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]