A
Alexander Grau
Hello,
I have some USB HID devices (presenters/laserpointers with buttons) that
I need to read the buttons in a specific application only (to map the
buttons to specific actions defined in that application).
The problem is that some devices pretend to be an HID keyboard (which is
good to use them without drivers) but not really useful in my special
case ...
| my devices
------------------------------------------------------------
mouse keyboard|laserpointer irpresenter
usage page 0x01 0x01 |0x01 0x0c
usage 0x02 0x06 |0x06 0x01
Windows loads kbdhid.sys for them, exclusively opens them and then I
cannot open the device in user mode (CreateFile) to read any Input
Reports from the user application.
Now I have these ideas:
1) Writing a keyboard class filter driver would not work I think, as I
need to filter out the keystrokes for some specific devices and not all
keyboards in general.
2) Reading the irpresenter (see table) in user mode works works, I think
because it has usage page 0x0c (application specific). If I could change
the usage page from 0x01 (keyboard) to 0x0c in the HID Descriptor for
the other devices, I'm sure kbdhid.sys would not exclusively open the
device. What is the easiest to implement this? Replacing the hidusb.sys
minidriver by a custom one?
3) Writing a USB function driver for a specific device might work. The
disadvantage is that I would have to implement all the HID logic there...
Can someone give some recommendations or even support me with a sample
driver that could help me further?
Thank you!
Alexander
I have some USB HID devices (presenters/laserpointers with buttons) that
I need to read the buttons in a specific application only (to map the
buttons to specific actions defined in that application).
The problem is that some devices pretend to be an HID keyboard (which is
good to use them without drivers) but not really useful in my special
case ...
| my devices
------------------------------------------------------------
mouse keyboard|laserpointer irpresenter
usage page 0x01 0x01 |0x01 0x0c
usage 0x02 0x06 |0x06 0x01
Windows loads kbdhid.sys for them, exclusively opens them and then I
cannot open the device in user mode (CreateFile) to read any Input
Reports from the user application.
Now I have these ideas:
1) Writing a keyboard class filter driver would not work I think, as I
need to filter out the keystrokes for some specific devices and not all
keyboards in general.
2) Reading the irpresenter (see table) in user mode works works, I think
because it has usage page 0x0c (application specific). If I could change
the usage page from 0x01 (keyboard) to 0x0c in the HID Descriptor for
the other devices, I'm sure kbdhid.sys would not exclusively open the
device. What is the easiest to implement this? Replacing the hidusb.sys
minidriver by a custom one?
3) Writing a USB function driver for a specific device might work. The
disadvantage is that I would have to implement all the HID logic there...
Can someone give some recommendations or even support me with a sample
driver that could help me further?
Thank you!
Alexander