// hidpi.h
typedef struct _HIDP_BUTTON_CAPS {
USAGE UsagePage;
UCHAR ReportID;
BOOLEAN IsAlias;
USHORT BitField;
USHORT LinkCollection;
USAGE LinkUsage;
USAGE LinkUsagePage;
BOOLEAN IsRange;
BOOLEAN IsStringRange;
BOOLEAN IsDesignatorRange;
BOOLEAN IsAbsolute;
USHORT ReportCount;
USHORT Reserved2;
ULONG Reserved[9];
union {
struct {
USAGE UsageMin;
USAGE UsageMax;
USHORT StringMin;
USHORT StringMax;
USHORT DesignatorMin;
USHORT DesignatorMax;
USHORT DataIndexMin;
USHORT DataIndexMax;
} Range;
struct {
USAGE Usage;
USAGE Reserved1;
USHORT StringIndex;
USHORT Reserved2;
USHORT DesignatorIndex;
USHORT Reserved3;
USHORT DataIndex;
USHORT Reserved4;
} NotRange;
};
} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
View the official Windows Driver Kit DDI referenceNo description available.
The HIDP_BUTTON_CAPS structure contains information about the capability of a HID control button usage (or a set of buttons associated with a usage range).
UsagePageSpecifies the usage page for a usage or usage range.
ReportIDSpecifies the report ID of the HID report that contains the usage or usage range.
IsAliasIndicates, if TRUE, that a button has a set of aliased usages. Otherwise, if IsAlias is FALSE, the button has only one usage.
BitFieldContains the data fields (one or two bytes) associated with an input, output, or feature main item.
LinkCollectionSpecifies the index of the link collection in a top-level collection's link collection array that contains the usage or usage range. If LinkCollection is zero, the usage or usage range is contained in the top-level collection.
LinkUsageSpecifies the usage of the link collection that contains the usage or usage range. If LinkCollection is zero, LinkUsage specifies the usage of the top-level collection.
LinkUsagePageSpecifies the usage page of the link collection that contains the usage or usage range. If LinkCollection is zero, LinkUsagePage specifies the usage page of the top-level collection.
IsRangeSpecifies, if TRUE, that the structure describes a usage range. Otherwise, if IsRange is FALSE, the structure describes a single usage.
IsStringRangeSpecifies, if TRUE, that the usage or usage range has a set of string descriptors. Otherwise, if IsStringRange is FALSE, the usage or usage range has zero or one string descriptor.
IsDesignatorRangeSpecifies, if TRUE, that the usage or usage range has a set of designators. Otherwise, if IsDesignatorRange is FALSE, the usage or usage range has zero or one designator.
IsAbsoluteSpecifies, if TRUE, that the button usage or usage range provides absolute data. Otherwise, if IsAbsolute is FALSE, the button data is the change in state from the previous value.
ReportCountHID defined report count. Available starting with API version 2.0. Call the HidP_GetVersion function to get the API version.
Reserved2Reserved for internal system use.
ReservedReserved for internal system use.
RangeSpecifies, if IsRange is TRUE, information about a usage range. Otherwise, if IsRange is FALSE, NotRange contains information about a single usage.
Range.UsageMinIndicates the inclusive lower bound of usage range whose inclusive upper bound is specified by Range.UsageMax.
Range.UsageMaxIndicates the inclusive upper bound of a usage range whose inclusive lower bound is indicated by Range.UsageMin.
Range.StringMinIndicates the inclusive lower bound of a range of string descriptors (specified by string minimum and string maximum items) whose inclusive upper bound is indicated by Range.StringMax.
Range.StringMaxIndicates the inclusive upper bound of a range of string descriptors (specified by string minimum and string maximum items) whose inclusive lower bound is indicated by Range.StringMin.
Range.DesignatorMinIndicates the inclusive lower bound of a range of designators (specified by designator minimum and designator maximum items) whose inclusive lower bound is indicated by Range.DesignatorMax.
Range.DesignatorMaxIndicates the inclusive upper bound of a range of designators (specified by designator minimum and designator maximum items) whose inclusive lower bound is indicated by Range.DesignatorMin.
Range.DataIndexMinIndicates the inclusive lower bound of a sequential range of data indices that correspond, one-to-one and in the same order, to the usages specified by the usage range Range.UsageMin to Range.UsageMax.
Range.DataIndexMaxIndicates the inclusive upper bound of a sequential range of data indices that correspond, one-to-one and in the same order, to the usages specified by the usage range Range.UsageMin to Range.UsageMax.
NotRangeSpecifies, if IsRange is FALSE, information about a single usage. Otherwise, if IsRange is TRUE, Range contains information about a usage range.
NotRange.Reserved1Reserved for internal system use.
NotRange.UsageIndicates a usage ID.
NotRange.StringIndexIndicates a string descriptor ID for the usage specified by NotRange.Usage.
NotRange.Reserved2Reserved for internal system use.
NotRange.DesignatorIndexIndicates a designator ID for the usage specified by NotRange.Usage.
NotRange.Reserved3Reserved for internal system use.
NotRange.DataIndexIndicates the data index of the usage specified by NotRange.Usage.
NotRange.Reserved4Reserved for internal system use.
Clients obtain a button capability array by calling HidP_GetButtonCaps or HidP_GetSpecificButtonCaps. These routines return an array of HIDP_BUTTON_CAPS structures in a caller-allocated buffer. The required buffer length is specified in the HIDP_CAPS structure returned by HidP_GetCaps.
For information about the capabilities of HID control values, see Collection Capability and Value Capability Arrays.
When a report descriptor declares an input, output, or feature main item with fewer usage declarations than the ReportCount, then the last usage applies to all remaining unspecified count in that main item. As an example, you might have data that required many fields to describe, possibly buffered bytes. In this case, only one value cap structure is allocated for these associated fields, all with the same usage, and ReportCount reflects the number of fields involved. Normally ReportCount is one. To access all of the fields in such a value structure would require using HidP_GetUsageValueArray and HidP_SetUsageValueArray. The HidP_GetUsageValue and HidP_SetScaledUsageValue functions will also work. However, these functions only work with the first field of the structure.