Jump to content
  • Advertisement


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


Input with Messages, AGAIN........

This topic is 6610 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

I have a function that interprets the key that is being pressed. It has one paramater and that is WPARAM. I then pass WParam to it, it then prints that key on the screen. Then Problem is that the keys, VK_A, VK_B...... are all the Ascii codes for Letter with Shift held down, so ''a'' is ''A''. What should I do to find out if shift is begin held down, and then convert the codes to lowercase, or how would I do this. Thanks a lot for your time. PS. Before I tried to stay as far away from the Windows Code as possible. But Im now facing my fears

Share this post

Link to post
Share on other sites
PSS: Just to tell yall, Im really proud of myself. I wrote a ASE file loader in about 3 hours of coding(over two days). IM SOOO HAPPY, Thanks again.

Share this post

Link to post
Share on other sites
For ASCII I wouldn't use the Virtual Key codes. For all the ASCII characters you can use their ASCII code equivalant. You process a WM_CHAR message instead of a WM_KEY. The wParam would equal the ASCII code. An example would be:

//in the middle of your regular message handler/switch statment
case WM_CHAR:

if(wParam == 32)
//space bar was pressed

Some of the more important ASCII keyboard codes are as follows:

8 = TAB
13 = ENTER
32 = SPACE
48 - 57 = 0 - 9
65 - 90 = A - Z
97 - 122 = a - z

Those are all decimal values, BTW. If you are using Visual C++ (or just go to msdn.micrsoft.com) you can find a complete ASCII chart by searching for "ASCII character codes" in the help.

Edited by - Sheltem on June 15, 2000 1:56:50 AM

Share this post

Link to post
Share on other sites
That was simple, exactly what the doctor ordered
PS: I dont like Dr. Peper, just thought it sounded cool

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!