Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trap a string of numbers with Keypress Event
Message
De
18/01/1999 22:39:55
 
 
À
18/01/1999 22:34:31
Jaime Vila
Miami Children's Hosp. - Radiology
Miami, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00177377
Message ID:
00177464
Vues:
33
>>>Can it be done ? rather than one key. I haven't found much discussion about Keypress event in documentation.
>>>
>>>I'm using a form where the object with focus is a grid. Want to be sure page-up & down are OK. . . . . Need to . . catch a string of numbers, look them up, and update some tables if found. Some Keypress samples would really help.
>>>
>>>TIA
>>
>>Keypress fires once every time a key is pressed, and the nKeyCode parameter only gives information about the key that was pressed. To catch a 'string' of numbers, ou would need a custom form property that stored previously pressed keys. You could then build the string by appending the value of the latest keypress onto the end of the form property. This is a pretty awkward solution though- perhaps a little more informaiton about what oyu are trying to do...
>
>Hello Erik,
>
>Basically I have a form with a pageframe, each page displays a grid of information for the user. I would like to allow the user to enter a id number with a barcode scanner and have the application immediately take control and perform a series of steps : look up the number and verify that it exists in a paticular table, if not add it along with a time stamp, then return to the grid.
>
>I tried using ON KEY LABEL in the grids init method and then preceed all of my barcodes with a speial key combination (Ctrl-F9), but I'd like to try to keep the barcodes as id numbers only.
>
>Your thoughts . . . . are greatly appreciated . . .approaching deadline . . . . tomorrow!!!
>
>Thanks

Easiest way to do this is to have the form ready for the input by having the focus set to a textbox that can take control of the input and do the work for you. THe textbox doesn't have to be visible, or on the visible portion of the page.

Most barcode scanners allow you to program in a special start and end character... you could have your form's keypress event watch for this character and set focus immediately to a textbox that would take the rest of the input.

If this is not feasible because of your scanner or whatever, I would just assign a hotkey to the form that would setfocus to your textbox, and instruct the user that to ready the form for the scanner input, she must press you hotkey first.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform