问题
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