Topic: HidSharp Feature request: HID device in write-only or read-only mode
Hi James,
I have one use-case where the current API is quite painful to work around, and I think adding support for write-only or read-only opening would help a lot of people.
My scenario:
I need to send Feature Reports to a HID mouse (mostly to control RGB lighting, DPI stages, polling rate, etc. on gaming mice).
On Windows:
The mouse is opened successfully with GENERIC_WRITE access
Writing Feature Reports (via HidD_SetFeature) works perfectly
But Windows refuses to open the same device with GENERIC_READ access.
When I do device.TryOpen(out var stream) in HidSharp, it requests both read and write access and fails.
Feature request / suggestion
An OpenMode / Access option in TryOpen(OpenConfiguration)
Something like:
var config = new OpenConfiguration();
config.SetOption(OpenOption.ReadAccess, true);
config.SetOption(OpenOption.WriteAccess, true);
device.TryOpen(config, out var stream);
This would allow clean write-only usage for exactly the kind of devices that Windows protects from being read (mice, some keyboards, touchpads, etc.) while still letting us send output/feature reports.
Thanks for considering this.