Michael,
I tried using something verrrry similar to your code, but I can't seem to process normal keystrokes. Only scans get input. Can you help?
Scott
LPARAMETERS nKeyCode, nShiftAltCtrl
LOCAL c
c= CHR(nKeyCode)
*-- the string read from the barcode is compiled into this.cBarcode
*-- this.lBarcodeReading is a flag to set barcode reading. (Simple keyboard
*-- input is processed as well).
IF !THIS.lBarcodeReading AND ! c $ 'TPNFPAEDX0123456789'
*-- key input not a number or button key
*-- set barcode reading on
THIS.lBarcodeReading= .T.
*-- initiate the compile string and save the character
THIS.cBarcode= c
ThisForm.Timer1.Enabled = .T.
* Add a new record
THISFORM.BUTTONSET1.cmdAdd.CLICK()
THISFORM.LBLDATE1.Text1.VALUE = DATETIME()
THISFORM.EMPID1.Text1.VALUE = gcEmpID
THISFORM.REFRESH
NODEFAULT
RETURN
ENDIF
IF THIS.lBarcodeReading
*-- barcode reading ends with a CR
IF c= CHR(13)
*-- deactivate barcode reading
THIS.lBarcodeReading= .F.
*-- do your thing with the compiled string
THISFORM.ProcessFixedScan()
ThisForm.cBarCode = ""
NODEFAULT
RETURN
ENDIF
*-- compile the string
THIS.cBarcode= THIS.cBarcode+c
NODEFAULT
RETURN
ENDIF
*-- otherwise process keyboard input
=DODEFAULT(nKeyCode,nShiftAltCtrl)
RETURN
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement