Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I set inkey speed on a form OR determine input speed
Message
From
18/12/2002 18:44:15
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
18/12/2002 16:45:26
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00734263
Message ID:
00734333
Views:
24
This message has been marked as the solution to the initial question of the thread.
>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()   && first time here
else
   nTimeDiff=seconds()-this.nTime
   if nTimeDiff<0.1
      this.nTime=seconds()  && set for the next character
      * everything's fine, we're on the scanner
   else
      * thisform.release() or whatever way out
   endif
endif
In textbox.lostfocus
this.nTime=0   && reset for the next run
...and that's it.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform