Win32 API keycode(I think?)

Started by
9 comments, last by Revelations 20 years, 8 months ago
I''ve been looking, for the past 2 days, for the hex keycode in the Win32 API for "d". Mind you not "D" which is &H44, I need lower case. API viewer says nothing about this, and neither does MSDN, so, can anyone help me out?
Advertisement
Search ''ASCII character codes''.

Niko Suni

In AScii "d" is 100, but converted to hex that comes out as numpad 4 in win32 API. I might end up having to trap a "d" and save that as a constant on form load, but thats a nasty hack, I wanna know if there is a cleaner way?
''d'' is 0x64

For future reference, in ASCII the seperation between the lowercase and uppercase letters is 32. eg. A = 0x41, B = 0x42 and a = 0x61, b = 0x62
--Aethon
0x64 comes out as numpad 4. I need a lower case "d" to use in my Sendmessage line, upper-case will not work for this, and the win32 constant list does not mention any lower-case letters.
Tried sending VK_D? I don''t think that is an uppercase D, just a d in general. Shift/Capslock status are checked separately, iirc.
I did a manual check of the shift and capslock status in code, and still got a capitol D out, with VK_D, which I have been using. This surprises me, you''d think Microsoft of all companies would put a reference somewhere for this, but I am still unable to find anything about it. Any more suggestions?
What do you mean ''it comes out as numpad 4''? Comes out from what?


"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
Lower case "d" doesn''t have a key code.

Lower case "d" is *TWO* keys - i.e. caps lock & "D" or shift & "D". With characters that have accents, umlauts and the like it can actually be THREE key presses. With IME it could be multiple key presses.

If this is for input, simply handle the WM_CHAR window message. With the relevent TranslateMessage() call in your message pump - that will give you the ASCII key value and automatically turn all the multiple key presses into a single [translated] ASCII (or UNICODE) value for you.

--
Simon O''Connor
ex -Creative Asylum
Programmer &
Microsoft MVP

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

It sounds to me like he''s using Visual Basic. Is this the case?
daerid@gmail.com

This topic is closed to new replies.

Advertisement