Click here to Skip to main content
15,891,923 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, i want to check in my MFC dialog based application how to check if A + 1 or B + 1 keys are being pressed. I'm using PreTranslateMessage(MSG* pMsg) function to check keys but i don't know what to do for key combination. Thx for help!
Posted
Comments
ThatsAlok 9-Aug-10 2:32am    
you can trap WM_KEYDOWN message!, but it isnot pretty straight forward to trap non system key (ALT,CTRL,SHIFT), without trapping second WM_KEYDOWN message or using GetAsyncKeyState Api!

1 solution

Have a look at GetAsyncKeyState[^] or GetKeyState[^]

The combination is never stored in your MSG struct. So if the above doesn't cut it for you, you will have to look for two messages, one for A and one for 1.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900