Skip to main content
GameDev.net gamedev.net
🔒 Locked

Hot Key Problems

Started by LordElectro Oct 26, 2002 at 9:13 AM 2 replies 1k views
Original Post
LordElectro
LordElectro
I have added hot keys to an application of mine. These hot keys need to be acivatable from anywhere in the system, not just when my application has focus. I installed a keyboard hook, and all works well, except if the desktop has focus, I am not getting the key. If any other app has focus, this works beautifully, but if the user is just clicking around in the desktop and hitting keys, nothing happens. Anyone have any idea why? Here''s how I''m called SetWindowsHook: hKeyHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)KeyHookProc, hDllModule, 0); if( hKeyHook == 0 ) return 0;
BetaShare - Run Your Beta Right!
LordElectro
LordElectro
Anyone? This problem is really putting a damper on my project and I''ve poured too many hours into finding the solution.
BetaShare - Run Your Beta Right!
Darrell L
Darrell L
Why don''t you try using RegisterHotKey/UnregisterHotKey instead of your system-wide keyboard hook? It''s kinda how hotkeys were meant to be setup in the system.
LordElectro
LordElectro
*Smacks self in head*

I erm umm well I umm err hmm uhh *runs but remembers to thank*
BetaShare - Run Your Beta Right!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.