Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WM_KEYDOWN OnKeyDown() Problem.

Status
Not open for further replies.

qedusa

Programmer
Jan 12, 2002
43
US
I'm having difficulties determining the actual ASCII character code for keys pressed. If I press 'h' key the ASCII code should be 104 (lowercase h) but I'm always getting the code 72 which is uppercase 'H'.

Can anyone explain why this is and how do I manipulate it if I can't be sure what case the letter is? For example, suppose a user types a lowercase 'h' - I need to be able to change the character code so it's replaced by an uppercase 'H'.
 
WM_KEYDOWN

LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_KEYDOWN
WPARAM wParam, // virtual-key code
LPARAM lParam // key data
)

16–23 Specifies the scan code. The value depends on the original equipment manufacturer (OEM).
*******************************************
This above is an exerpt from MSDN.
According to the above documentation u need to mask the rest of the bits and shift the value to get the actual
scan code.

Check if u are correctly calculating.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top