Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.clipper

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 11-23-2011, 11:58 AM
Scott Coffey
Guest
 
Posts: n/a
Default Measure speed of input


I have an application that reads a gift card number (five digits) from
a magnetic stripe on a gift card. In addition, the user may also key
the gift card number. I would like to know whether the number was
scanned or keyed. I at first thought this was impossible, since the
scanner is a keyboard wedge, but then I realized that if I could
capture the *speed* of the input, then I would know if it were
scanned, since it seems unlikely that a human could key numbers as
fast as they could be scanned from a magnetic stripe.

My question is: is there a way to determine the speed of input of this
five digit number?
--
ScottCoffey at Scott dash(-) Coffey dot net
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 11-23-2011, 01:00 PM
Stephen Quinn
Guest
 
Posts: n/a
Default Re: Measure speed of input

Scott

> My question is: is there a way to determine the speed of input of this
> five digit number?

Maybe detect key stokes and sample time between each one.
or
detection of the enter key when entering by keyboard

Usually there's a leading start character(s) to identify a 'card number' to
the scanner otherwise it wouldn't know where to start interpreting from.

CYA
Steve


Reply With Quote
  #3 (permalink)  
Old 11-23-2011, 02:08 PM
dlzc
Guest
 
Posts: n/a
Default Re: Measure speed of input

Dear Scott Coffey:

On Nov 23, 5:58*am, Scott Coffey <n...@noemail.com.invalid> wrote:
> I have an application that reads a gift card number
> (five digits) from a magnetic stripe on a gift card.
>*In addition, the user may also key the gift card
> number. *I would like to know whether the number
> was scanned or keyed. *I at first thought this was
> impossible, since the scanner is a keyboard wedge,


These wedges usually have guard characters as part of their data
stream, so the input can be directed to an input handler for exactly
this reason. Check out the API for the particular wedge.

> but then I realized that if I could capture the
> *speed* of the input, then I would know if it were
> scanned, since it seems unlikely that a human
> could key numbers as fast as they could be scanned
> from a magnetic stripe.


More generally the spacing between "keystrokes" should be more random
with a human. My mother can overflow the keyboard buffer of a
standard keyboard on alpha, but likely not numeric. So on alpha, she
could fail either variant of this method.

> My question is: is there a way to determine the
> speed of input of this five digit number?


Just record seconds() for the first and last, or each, character.
Then "calibrate" it for the typical mag card reader, and open it up
just a little bit.

Which means you cannot use a Get...

David A. Smith
Reply With Quote
  #4 (permalink)  
Old 11-23-2011, 11:45 PM
Klas Engwall
Guest
 
Posts: n/a
Default Re: Measure speed of input

Hi David/Scott

> Just record seconds() for the first and last, or each, character.
> Then "calibrate" it for the typical mag card reader, and open it up
> just a little bit.
>
> Which means you cannot use a Get...


A modified getsys for this specific get should be able to do it. Add
seconds() to an array after every keypress and analyze the array after
K_ENTER has been pressed.

I sometimes use a modified getsys to timeout the current READ and kill
the application if time() is after 22:00 and there has been no keyboard
activity in one hour. So the requirement is similar, only a bit
different :-)

There used to be a lot of talk about creating alternate getsys-es "in
the old days", and IIRC it is discussed in the paper manual.

Regards,
Klas
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 08:14 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.