Best way to handle input from a keyboard "wedge"

Posted by Mykroft on Stack Overflow See other posts from Stack Overflow or by Mykroft
Published on 2008-09-03T19:55:05Z Indexed on 2010/04/06 17:53 UTC
Read the original article Hit count: 297

Filed under:
|
|

I'm writing a C# POS (point of sale) system that takes input from a keyboard wedge magcard reader. This means that any data it reads off of a mag stripe is entered as if it were typed on the keyboard very quickly. Currently I'm handling this by attaching to the KeyPress event and looking for a series of very fast key presses that contain the card swipe sentinel characters.

Is there a better way to deal with this sort of input?

Edit: The device does simply present the data as keystrokes and doesn't interface through some other driver. Also We use a wide range of these types of devices so ideally a method should work independent of the specific model of wedge being used. However if there is no other option I'll have to make do.

© Stack Overflow or respective owner

Related posts about c#

Related posts about best-practices