Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Trapping Function Keys

Posted on 1998-06-05
2
Medium Priority
?
161 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview

927 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