Support Forums

Full Version: [help] How to run a program detecting any keystroke [help]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to have a program running in the background as it detects any keystroke to active a certain command. For example "Enable Internet" would be keystroke Shift + W, and it would enable internet connection. You get the point, but I want the program to be hidden completely. Thank you.
I'm not sure, but I think this will do the trick: http://www.autohotkey.com/
You'd need to hook keyboard events, and personally I would recommend using the user32.dll - Windows API to do that, but it's not as easy as you might think it is Smile I know have a good understanding on how to hook windows messages, but I would suggest looking into Windows messages before you can have any kind of comprehension about how to hook those handles.

Some out there use GetAsyncKeyState() which is probably your best bet if you just want something stupid simple. But there's benefits of Windows Messages. I've personally never tried a global hook over GetAsyncKeyState() but maybe it's possible. Smile