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

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

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