Archived

This topic is now archived and is closed to further replies.

Keyboard input???

This topic is 5238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

On the MSDN website I found a function to get input from all the keys on the keyboard at the same time, GetKeyboardState, but I dont know how to use or access the virtural keys that are returned in the pointer array that is passed through the function. Can anyone help me in using this function or another method of getting all keyboard input at the same time using Win32 API. Any help is apprecieated. THX, JAP

Share this post


Link to post
Share on other sites
The virtual key codes are defined here.
In the array, you just need to check the right number, and you should get whether it''s pressed or not. For the most part the key codes will correspond with the ascii codes, so you can do this:

if (key[''a'']){
// whatever
}
if (key[VK_UP]){

}

-Arek the Absolute

Share this post


Link to post
Share on other sites
JIMBond21, I would like to applaud you for the greatest post in history. Not only have you included all the information we need, you have also indicated to us that you have searched on your own, and managed this in a succint manner. I think this post should be framed and hung for all people to see as a shining example.

note the complete lack of < sarcasm> tags.


Do you use your powers for good or for awesome?
My newly updated site | The Cutter Project | Association of Computing Machinery

[edited by - capn_midnight on August 13, 2003 11:22:33 AM]

Share this post


Link to post
Share on other sites