HIDUsage:
Filter:
Classes | External Control > HID

HIDUsage : Object

Helper class to read usage information from HID usage tables
Source: HID_API.sc

Description

HID functionality is described by the USB HID standard usage tables. Each element and collection has a usage page and index, describing the type of control that it provides. This class allows to query the name of a usage and page based on the indices read from the device. This class is primarily used internally by other HID classes.

Class Methods

HIDUsage.getUsageDescription(usagePage, usage)

Retrieve the standard usage name and pagename of an HID usage element or collection.

Arguments:

usagePage

usage page number

usage

usage index

Returns:

an Array with the pageName and usageName

HIDUsage.hutDirectory

HIDUsage.hutDirectory = value

Directory where the yaml files with the HID usage tables are stored.

HIDUsage.readHUTFile(yamlfile)

Reads and parses the HID usage table file. Called from getUsageDescription to read in the usage table.

Arguments:

yamlfile

the filename of the yamlfile with a particular usage table, relative to the hutDirectory.

Returns:

an IdentityDictionary representing the table

HIDUsage.getUsageIds(usageName)

Retrieve usage id and page id from the usageName.

Arguments:

usageName

the usage name

Returns:

an Array with the page id and the usage id

HIDUsage.idsToName(page, usage)

Retrieve the standard usage name and pagename of an HID usage element or collection.

Arguments:

page

the usage page id

usage

the usage id

Returns:

the usage name

HIDUsage.usageIDsToName

MultiLevelIdentityDictionary containing a map of page ids, usage ids to usage names.

HIDUsage.usageNameToIDs

IdentityDictionary containing a map of usageNames to page ids and usage ids.

Inherited class methods

Instance Methods

Inherited instance methods

Examples

Get the usage description for a collection or element with usage page 1 and usage index 5