Skip to main content
gamedev.net
🔒 Locked

Win32 input question

Started by TiitHns 1 reply 550+ views
Original Post
TiitHns
TiitHns
Is there any good way to determine if any letter key has been pressed (a,b,c + 0-9 and so on). And skip any ignore any other keys like VK_UP etc.
http://www.daily-it.com
Endurion
Endurion
Use WM_CHAR and check wParam to be one of your wanted characters.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
Evil Steve
Evil Steve
I'd recommend Endurion's method, but you can also use GetAsyncKeyState

Example (untested):
bool IsKeyDown(char ch){   return !!(GetAsyncKeyState(ch)&0x8000);}

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.