|
|
If you want a simple method using the WM_ message, there is this method:
1) Detect WM_KEYDOWN messages and store key value. Send message/perform action associated.
2) While your game loop progresses, and you need to check for the key press again( while it is still pressed on the keyboard), provide a method to check for the key value in the array of values stored from WM_KEYDOWN message.
3) Detect WM_KEYUP message and remove value from array/list.
Make sure you only add the key value to the array/list once!
Beware, this will have some issues with right vs. left detection of Shift, Ctrl, Alt unless you write extra code to detect these repeat messages and grab the keyboard state with WIN32 API calls.
corey
|