Solved

Trapping Function Keys

Posted on 1998-06-05
2
154 Views
Last Modified: 2010-04-06
I have a Edit TEdit, used for a bar code scanner.  In the code, after I scan a bar code, I do a TEdit.SetFocus, to keep the cursor on this field so I can scan another bar code label.  This works fine with one exception.  I can't tell it I'm done.  I would like to be able to hit the 'F4' key to say I'm done with scanning, let me move to the next field.  The only problem is that I'm using the 'OnKeyPress' event.  It doesn't recognize function keys.

How do I get the OnKeyPress to accept function keys?
Thanks
0
Comment
Question by:gspears060598
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
Greedy earned 50 total points
ID: 1350899
use the onKeyDown and look for Key = VK_F4
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1350900
You might also want to know that the form has a property called KeyPreview.  If you set this to true you can have the Form look at the keyboard events first...might come in handy if you only want to write one event handler.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now