Link to home
Start Free TrialLog in
Avatar of gspears060598
gspears060598

asked on

Trapping Function Keys

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
ASKER CERTIFIED SOLUTION
Avatar of Greedy
Greedy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Greedy
Greedy

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.