Assign plasmoid global shortcut to custom action

Simone Gaiarin simgunz at gmail.com
Mon Jul 21 13:22:17 UTC 2014


Yes. It's kde4.


2014-07-21 10:29 GMT+02:00 Marco Martin <notmart at gmail.com>:

> On Sunday 20 July 2014, Simone Gaiarin wrote:
> > Hi all,
> > I'm trying to use the global shortcut that the user can configure from
> the
> > "Shortcut configuration page" of a plasma applet, to trigger a KAction
> and
> > let the plasmoid do something.
> >
> > I've done this
> >
> >     //Setup the action
> >     m_toggleAction = new KAction("ToggleAction", this);
> >     //Add action to the plasmoid action collection
> >     addAction("ToggleAction", m_toggleAction);
> >     m_toggleAction->setGlobalShortcut(globalShortcut());
> >     connect(m_toggleAction, SIGNAL(triggered(bool)), this,
> SLOT(toggle()));
> >
> > but nothing happens when I trigger the shortcut. Do anyone know what I'm
> > missing?
> > Is there any plasmoid that is using the global shortcut feature?
> >
> > Thanks
>
> hmm, that's kde4, right?
>
> --
> Marco Martin
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140721/67dc793b/attachment-0001.html>


More information about the Plasma-devel mailing list