Re: [Vala] Global key shortcuts



On Sat, Aug 20, 2016 at 4:33 AM, rastersoft <raster rastersoft com> wrote:
I'm working on a program that needs to respond to an specific key
always, so when I press it, it will show its window. How can I do it
from Vala? Is it possible to do that in a way compatible with wayland?
(let's say: register a DBus method to be called when that key is
pressed, or something like that...)

So even when the window is hidden or not focused or whatnot? That's more of a desktop integration issue, isn't it? Maybe there is a FDO/XDG method for registering them.

In any case, I imagine you'll probably want to implement GApplication/GtkApplication and have you app raise/focus/etc the window in response to the activate signal. The desktop then just needs to activate the app in response to the global shortcut, by invoking that signal via DBus or by executing a new instance of the app, which would also send the signal to the already running instance.

//Mike

--
⊨ Michael Gratton, Percept Wrangler.
⚙ <http://mjog.vee.net/>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]