Hi,
What's the best way to register a global hotkey to a functionality of my application?
And how can I catch the event of that key in my application?
I tried to search in the forum, but I'm having some dificulties in having good results in the search function of the new forum.
Thank you!
Global hotkey
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: Global hotkey
Here is an example with RegisterHotkey_() : http://www.purebasic.fr/english/viewtop ... 13&t=26781
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: Global hotkey
Thank yougnozal wrote:Here is an example with RegisterHotkey_() : http://www.purebasic.fr/english/viewtop ... 13&t=26781

Here's what I did:
Code: Select all
RegisterHotKey_(#Null, 0, #MOD_CONTROL, #PB_Shortcut_1)
; and in the main loop:
repeat
ev=WaitWindowEvent()
if ev=#WM_HOTKEY
debug "key detected"
endif
until ev=#PB_Event_CloseWindow