Solved

Trapping Function Keys

Posted on 1998-06-05
2
158 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
[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
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

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

Suggested Solutions

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 Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

751 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