(MFC, Visual C++) Keypress Detection in a dialog...
I've got a dialog up and running that is going to detect compound keypress (keys like CTRL+5 or just 5). I've currently got a cheap way of doing it using GetAsyncKeyState(vkey);. Whenever I am running that function in a while loop, the application freezes up until (one, or two) keys are pressed
How can I detect keypress (the ALT,CTRL, or shift key might be pressed, depending on weather the user wants to use those keys as hotkeys). Also, it needs to detect mouse clicks, like mouse buttons 1-5. (left mouse, middle, right, xbutton1, xbutton2).
I also tried overiding the PreTranslateMessage to detect for WM_KEYDOWN and WM_KEYUP messages, but I don't like this way at all, very "code-hackish".
I'm just trying to provide an interface where the user clicks a button to "set the xxxxx hotkey" and then a dialog pops up with keys the user may be pressing (ALT+5 or CTRL+T or Z or 4 (or any other 1-2 key combonation ).
I've done a lot of Googling on this topic, and my searches haven't resulted in much success :|
Any help given will be greatly appreciated.
Thanks in advance,