identifying keystrokes

On my application I have an edit box in which the user enters a string.  I need to be able to tell within the OnChangeEditBox function what the last key the user pressed was, especially whether it was the delete key.

If anyone has any ideas I would be extremely grateful.  Thanks!
LVL 1
sjhlAsked:
Who is Participating?
 
WynCommented:
You should subclass CEdit and create a new CMyEdit box or subclass the current CEdit control.
Then map WM_KEYUP to your CMyEdit and save the message value into a global or static variable.
Later , in your OnChangeEditFunction(),you'd check the variable to get what key was just released.


Free to ask.

Regards
W.Yinan
0
 
WynCommented:
Btw:You can also store it in PreTranslateMessage(),first check if it's WM_KEYUP and store it.
0
 
sjhlAuthor Commented:
Looks a great way to go about it.
However I found an easier method suitable for my application.

thanks
Sjhl.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.