|
|||
|
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 |
|
|
||||
|
||||
|
|
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|