This library provides a cross-platform .NET Standard encoding of the the USB HID Usage Tables. It is a companion NuGet for HIDDevices, though it can be used on it's own.
The latest USB specification PDF URL that was used for auto-generation can be found in HIDUsageTablesPDF.url, and the generated files found in this folder explicitly state the current specification and generation date in their headers.
Publishing an updated NuGet whenever the specification changes is relatively quick, as the build process can download the raw PDF from usb.org and generate new code automatically. Unfortunately, I do not monitor the specifications for updates, so please create an issue if you would like to prompt me to update - I usually respond quickly.
For convenience, the full HID Usage tables are exposed and described via the Usages
, UsagePages
and UsageTypes
classes. These can be retrieved directly using the uint
identifier or the convenience enums, all of which have
the Page
suffix.
// The enums can be cast to a Usage to retrieve full information about the Usage and its page.
Usage usage = ButtonPage.Button0;
Console.WriteLine($"Usage: {usage.Name}; Page: {usage.Page.Name}");