>I have a FoxDos routine for a login that determines if the user is using a scanner by doing a read timeout with inkey(.1). The inkey speed is so fast that only if the scanner is used can the data actually be read. If the user tries to type an ID the form releases because the speed is too slow. This was designed as a security feature so only scanned badges could be used to identify the user to the Foxpro system.
>
>I need to do a matching routine in VFP7. Is there a way to set the input speed on a form OR to test the speed that the data in a text box was entered at? I don't think I can detect the input device because this scanner Y's into the keyboard cable and the PC gets both scanned and typed data through the keyboard port.
It'd be simple - add a property to your textbox, say, nTime. Set it to zero.
In interactive change:
if this.nTime=0
this.nTime=seconds()
else
nTimeDiff=seconds()-this.nTime
if nTimeDiff<0.1
this.nTime=seconds()
else
endif
endif
In textbox.lostfocus
this.nTime=0
...and that's it.