• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

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!
0
sjhl
Asked:
sjhl
  • 2
1 Solution
 
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

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now