问题描述
我有一个条形码扫描仪用作HID设备.每次扫描条形码时,条形码都会直接进入Windows键盘,例如,如果打开记事本,我会看到在其中键入的条形码.
I have a barcode scanner works as HID device. Everytime a barcode scans it goes directly to windows keyboard, for example if I open notepad I can see the barcode typed there.
据我所知,可以从您的HID设备读取HID数据.
As far as I know programmatically is it possible to to read HID data from your HID devices.
但是,如果用户已经在带有文本编辑控件的表单上,该怎么办?扫描的代码将进入文本框.
But what happens if the user is already on a form with a text edit control? The scanned code will go inside the text box.
您可以阻止传入的文本并仅进行后台处理吗?
Can you block incoming text and make a background-only processing?
你能解释一下理论吗?
推荐答案
您可以将扫描仪设置为使用USB-HID(POS)设置.扫描仪设备的条形码设置数据表应具有此数据表.我使用这个项目来测试我的扫描仪. http://www.codeproject.com/Articles/18099/A-USB-HID-Component-for-C
You can set up your scanner to use USB-HID(POS) setting. Your datasheet of barcode settings for the scanner device should have it. I use this project to test my scanners. http://www.codeproject.com/Articles/18099/A-USB-HID-Component-for-C
这篇关于HID设备在编程时如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!