How to Captur a "Hot key" (F8 for example) ?

I would like to wite down a program which captures F8 (F8 is just an example).
whenever the user presses F8, I would like my program to "Jump".

Who is Participating?
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Alrighty, I'm not a C++ developer, but look into use the RegisterHotKey() API:

*Be aware, though, that if another application has already claimed your desired hot-key combo then you cannot also register it.  In that case, you would either have to poll the keyboard state with the GetAsyncKeyState() API (via a Timer...not the preferred method), or intercept ALL keystrokes in the same using a low level keyboard hook and WH_KEYBOARD_LL.
Mike TomlinsonMiddle School Assistant TeacherCommented:
Hi zmau,

What LANGUAGE and VERSION are you working in here?....
Hotkey Detective 2: Download It Here,1759,944583,00.asp


Hotkey Detective 2 fills this gap by showing you a list of all the hotkeys defined on your system. Duplicate hotkey assignments are displayed in red. To change a hotkey, simply select it in the list and click the Change key button. Click Locate in Explorer to make other changes to the shortcut, or remove it entirely. The program also lets you print out a list of your hotkey assignments.

Never used it personally, but have seen it online on more than one occassion....

ShortcutKey 2.2
zmauAuthor Commented:
Thanks all

I am using VC 6, the language is C++, the OS is XP.

"ShortcutKey 2.2" and "Hotkey Detective 2", sounds like an answers to a previous questions........
Can you put your answer there so I can give you the score ?

I'll try them (Curiosity killed the cat).
Do you have any idea "how do they work" ?

Still, I want to know how do I do it in a software which I am installing to other people on other computres.....

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.