[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do you check keystrokes?

Posted on 1998-12-05
3
Medium Priority
?
550 Views
Last Modified: 2006-11-17
How do you check for keystrokes in an EDIT1.text field?
I want to do something only when the enter key is pressed.
I do not want to always do a routine when i type any key in.
I want to do it only after the Enter key is pressed.

Any idea?
HELP!! :)
0
Comment
Question by:waipahu
[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
3 Comments
 

Accepted Solution

by:
elkiors earned 40 total points
ID: 1349379
In the OnKeyPress event for your edit box add this

If (Key=chr(13)) THEN
BEGIN
  {Do Processing for enter key pressed here}
END;

You can also trap keys by using the onkeydown and onkey up events and use the windows constants to test the key. Have a look at the Windows.pas interface code in the source directory. Here are some windows constants:

VK_RETURN   Enter Key
VK_ESCAPE   Escape Key

Darren


0
 

Expert Comment

by:v_pasupuleti
ID: 1349380
Hi Waipahu,
check if the default property is set to false if you are using a ok bitbutton in the form also set the form key preview property is set to true if you want to do it at a form level.

Vijay
0
 

Author Comment

by:waipahu
ID: 1349381
Thanks so much!
It worked!!!!!!!!!!!!!!!
I really appreciate all your help!!!!!!!!!!!!!!!!
Great!


0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 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