HidLibrary icon indicating copy to clipboard operation
HidLibrary copied to clipboard

UsagePage and Usage should be ushort

Open luni64 opened this issue 3 years ago • 1 comments

Would be nice if HidDevice.Capabilities.UsagePage and HidDevice.Capabilities.Usage would be declared as ushort instead of short. Currently an ugly cast is required to check for large values:

var device= HidDevices.Enumerate(VID,PID) 
           .Where(d => d.Capabilities.UsagePage == unchecked((short)0xFFC9) && d.Capabilities.Usage == unchecked((short)0xF123) 
           .FirstOrDefault();    

luni64 avatar Apr 23 '21 07:04 luni64

I believe that you're right, so it would be worth making a PR.

mjmatthiesen avatar Jul 23 '21 16:07 mjmatthiesen