如何阅读从USB HID设备的输入? [英] How do I read input from a USB HID device?

查看:143
本文介绍了如何阅读从USB HID设备的输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个应用程序在一个salespoint后台运行从USB扫描仪读取输入。
我怎样才能从C#扫描仪的输入?
而且我可以扫描仪和USB键盘区分? (Scanner是一款HID设备)

I'm making an application to run in the background on a salespoint to read input from a usb scanner. How can I get the input of the scanner from C#? And can I differentiate between the scanner and a usb keyboard? (Scanner is a HID device)

推荐答案

我这样做是成功地运用在$ C $的CProject一个原始输入实施前:

I did this successfully before using a "Raw Input" implementation on CodeProject:

  • Raw Input

它可以让你同时接收输入(什么是钥匙是$ P $,如果它模仿键盘pssed),以及区分它来自哪个设备。

It allows you to receive both the input (what "keys" are pressed if it mimics a "keyboard") as well distinguish which device it came from.

这篇关于如何阅读从USB HID设备的输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆