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

Started by
2 comments, last by Esap1 23 years, 10 months ago
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
Advertisement
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.
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
That was simple, exactly what the doctor ordered
PS: I dont like Dr. Peper, just thought it sounded cool

This topic is closed to new replies.

Advertisement