C# HID Library using Windows Raw Input. Most useful to handle inputs from IR remotes, gamepads, joysticks or any Human Interface Devices.
You can get a pretty good understanding of what this library can do be running our HID Demo.
The easiest way to use this library in your own project is to add a reference to the NuGet package that suits your needs.
x64 | x86 | Legacy |
---|---|---|
To get started with this library take a look at HID Demo code. Basically there are just three things you need to do to get it working:
- Instantiate a
SharpLib.Hid.Handler
specifying which kind of raw input you want to listen to. - Register with your HID handler
OnHidEvent
event. - Feed your HID handler the Windows Raw Input from
WM_INPUT
messages.
Taking a look at older and simpler version of the HID Demo code can give you a better idea of what a minimal implementaiton looks like.
- https://stackoverflow.com/questions/956669/does-setupdigetclassdevs-work-with-device-instance-ids-as-documented
- https://docs.microsoft.com/en-us/windows/win32/api/setupapi/nf-setupapi-setupdigetclassdevsw
- https://docs.microsoft.com/en-us/windows-hardware/drivers/install/determining-the-parent-of-a-device
- https://docs.microsoft.com/en-us/windows-hardware/drivers/install/retrieving-device-relations
- https://docs.microsoft.com/en-us/windows/win32/api/setupapi/nf-setupapi-setupdigetdevicepropertyw
- https://github.com/BrianPeek/WiimoteLib
- https://social.msdn.microsoft.com/Forums/vstudio/en-US/8a8ae70a-fdcc-423a-a5c5-5b02d2f207a7/enumerate-human-interface-devices?forum=csharpgeneral