?
Solved

identifying keystrokes

Posted on 2000-03-12
3
Medium Priority
?
159 Views
Last Modified: 2013-11-20
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
Comment
Question by:sjhl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Wyn earned 240 total points
ID: 2609694
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
 
LVL 5

Expert Comment

by:Wyn
ID: 2609697
Btw:You can also store it in PreTranslateMessage(),first check if it's WM_KEYUP and store it.
0
 
LVL 1

Author Comment

by:sjhl
ID: 2609847
Looks a great way to go about it.
However I found an easier method suitable for my application.

thanks
Sjhl.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question