www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Global hotkey with GTK based application under Windows

Hello! I implement a GTK-D based application for Windows and 
Linux. In case of Linux there isn't any problem, I use binding[1] 
for libkeybinder. In case of Windows I can't find convinient way 
to implement global shortcuts. There is a way to get it done is 
use of WinAPI but it's not convinient by a couple of things.

WinAPI provides RegisterHotKey method[2] but I have no idea how 
to get HWND using GTK-D. If I get it done I get a problem to 
handle it. Design of WinAPI means handling of hotkey in a loop 
like so[3]. I could get the thing done using tick callback[4] but 
I use the callback for another stuff, and I don't know whether 
GTK-D supports multiple tick callbacks, I can't get it at least.

If anyone has an idea, please tell me because I ran out. Thanks 
in advance!

[1] https://github.com/dhasenan/keybinder
[2] 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646309.aspx
[3] http://vpaste.net/FwhMD
[4] 
http://gtk-d.dpldocs.info/gtk.Widget.Widget.addTickCallback.1.html
Apr 01 2018