Archived

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

Esap1

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

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
9 = BACKSPACE
10 = CTRL + ENTER
13 = ENTER
27 = ESCAPE
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