开发者

Capture barcode from background in VB 2010

I'm looking to create a program which will run in the background, but will capture an开发者_高级运维y data input by a barcode scanner. Since barcode scanners work more or less as keyboards (I'm not familiar with the specifics of the implementation, but my reading and their behaviour suggests this) my plan was to simply capture all keypresses and look for a distinctive pattern (sequence of numbers entered in improbably fast succession).

I'm a little concerned, however, about the fact that this will require holding up keypresses until I confirm a match. The holdup will probably be barely noticable, but it's still not ideal. My quesetion is: is there any better means of implementation than simple key and pattern detection, for example detecting that the keypresses originate from a barcode scanner?

Thanks for any help you can offer, Wyatt


Take a look at How to Check if User input is from Barcode Scanner or Keyboard?


You don't need to capture any keypress events. All you have to do is set the barcode scanner to use a COM Port or USB-HID(POS) device and read the scanned data behind the scenes. A good article is at http://www.codeproject.com/Articles/18099/A-USB-HID-Component-for-C.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜