|
-
April 1st, 1999, 01:25 PM
#1
Q: Is SHIFT key pressed?
Hi everyone.
I'm working on a subclassed CEdit control (actually the well-known CInPlaceEdit found here at Codeguru) and I have a very simple (hopefully) question about the OnChar method.
How do I tell if the Shift key is also pressed? I want to process the Tab key and similarly I want to process the Shift+Tab key combination.
There is this UINT nFlags thingy but does that tell me anything I want to know?
I've tried to use GetKeyState( VK_SHIFT ) and GetAsyncKeyState( VK_SHIFT ) but somehow that also returns nonzero if the shift key has been pressed at any time during the lifetime of the control.
Any ideas?
With best regards,
Daniel B. Sig.
-
April 1st, 1999, 02:11 PM
#2
OnChar() Is Not so helpful
Because there is not necessarily a one-to-one correspondence between keys pressed and OnChar calls generated, the information in nFlags is generally not useful to applications. The information in nFlags applies only to the most recent call to the OnKeyUp member function or the OnKeyDown member function that precedes the call to OnChar. -From MSDN Library
Regards
Deep
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|