2

I want to capture raw data from a USB mouse using libusb library by C#.

I can read data with the UsbEndpointReader class, but there is a problem.

When I try to read data it seems that Windows tries to read too, and I can't read all data and the OS can't either, because mouse movements have some steps. I want to read all data and let the OS read those data too (I mean without problem in moving the cursor).

Another problem that I have is that I don't know how can I get HID descriptor. I know it's possible by calling GetDescriptor method, but how can I do it?

Peter Mortensen
31.4k22 gold badges110 silver badges134 bronze badges
asked Dec 3, 2013 at 19:21

1 Answer 1

1

To prevent conflict with Windows reading from the mouse, you should disable the associated mouse instance in Device Manager.

If you want shared access to mouse data, use a low-level mouse hook, not libusb. If you really want it in USB HID message format, you can use a filter driver to get a copy of every request and response Windows gets from the device.

answered Dec 14, 2013 at 16:56
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.