Get HID Device data only from my delphi application

六眼飞鱼酱① 提交于 2020-01-06 16:52:30

问题


I have 2 keyboards attached via usb. I want that my application to receive input only from one of them. I tried to use the TJvHidDeviceController i sucesefully get a handle to the device but i can't get any data.

Is it possible to prevent other applications to receive input from the second keyboard ?


回答1:


Is it possible for your set-up to not load a device driver for the keyboard you want to listen to? If it is, you could try this method:

  • Use QueryDosDevice to list all devices on your computer. You can either search the vendor and device ID in the list if you know them, or build a list before and after you plug in the second keyboard and see which item(s) appear on the list.
  • Use CreateFile with the \\?\ prefix to connect to this device and read/write raw data from it.


来源:https://stackoverflow.com/questions/9162508/get-hid-device-data-only-from-my-delphi-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!