Mac Developer Library

Developer

IOHIDKeys.h Reference

Options
Deployment Target:

On This Page

IOHIDKeys.h Reference

Included Headers

  • <sys/cdefs.h>

  • <IOKit/hidsystem/IOHIDParameter.h>

Data Types

See the Overview section above for header-level documentation.

  • Abstract data type used as a unique identifier for an element.

    Declaration

    Objective-C

    #ifdef __LP64__ typedef uint32_t IOHIDElementCookie; #else typedef void * IOHIDElementCookie; #endif

    Import Statement

    Availability

    Available in OS X v10.0 and later.

Constants

See the Overview section above for header-level documentation.

  • Declaration

    Objective-C

    #define kIOHIDTransportKey "Transport" #define kIOHIDElementCookieKey "ElementCookie" #define kIOHIDElementCookieMinKey "ElementCookieMin" #define kIOHIDElementCalibrationDeadZoneMaxKey "CalibrationDeadZoneMax" #define kIOHIDElementCalibrationDeadZoneMinKey "CalibrationDeadZoneMin" #define kIOHIDElementCalibrationDeadZoneMaxKey "CalibrationDeadZoneMax" #define kIOHIDElementCalibrationGranularityKey "CalibrationGranularity" #define kIOHIDElementCalibrationMaxKey "CalibrationMax" #define kIOHIDElementCalibrationMinKey "CalibrationMin" #define kIOHIDElementCalibrationSaturationMaxKey "CalibrationSaturationMax" #define kIOHIDElementCalibrationSaturationMinKey "CalibrationSaturationMin" #define kIOHIDElementCookieKey "ElementCookie" #define kIOHIDElementCookieMinKey "ElementCookieMin" #define kIOHIDElementKey "Elements" #define kIOHIDTransportKey "Transport"

    Constants

    • HID Device Property Keys

      HID Device Property Keys

      Keys that represent properties of a paticular device.

      Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices.

      Please note:

      kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching.

      Thus we have added 3 additional keys:

      • kIOHIDDeviceUsageKey

      • kIOHIDDeviceUsagePageKey

      • kIOHIDDeviceUsagePairsKey

      kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device.

      An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary.

    • HID Element Dictionary Keys

      HID Element Dictionary Keys

      Keys that represent properties of a particular elements.

      These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements.

    • HID Element Match Keys

      HID Element Match Keys

      Keys used for matching particular elements.

      These keys should only be used with a matching dictionary when searching for elements via copyMatchingElements.

    • kIOHIDElementCalibrationDeadZoneMaxKey

      kIOHIDElementCalibrationDeadZoneMaxKey

      The maximum bounds near the midpoint of a logical value in which the value is ignored.

      The dead zone property is used to allow for slight differences in the idle value returned by an element.

      Available in OS X v10.5 and later.

    • kIOHIDElementCalibrationDeadZoneMinKey

      kIOHIDElementCalibrationDeadZoneMinKey

      The minimum bounds near the midpoint of a logical value in which the value is ignored.

      The dead zone property is used to allow for slight differences in the idle value returned by an element.

      Available in OS X v10.5 and later.

    • kIOHIDElementCalibrationDeadZoneMinKey

      kIOHIDElementCalibrationDeadZoneMinKey

      The maximum bounds near the midpoint of a logical value in which the value is ignored.

      The dead zone property is used to allow for slight differences in the idle value returned by an element.

      Available in OS X v10.5 and later.

    • kIOHIDElementCalibrationGranularityKey

      kIOHIDElementCalibrationGranularityKey

      The scale or level of detail returned in a calibrated element value.

      Values are rounded off such that if granularity=0.1, values after calibration are 0, 0.1, 0.2, 0.3, etc.

      Available in OS X v10.5 and later.

    • kIOHIDElementCalibrationMaxKey

      kIOHIDElementCalibrationMaxKey

      The maximum bounds for a calibrated value.

      Available in OS X v10.5 and later.

    • kIOHIDElementCalibrationMinKey

      kIOHIDElementCalibrationMinKey

      The minimum bounds for a calibrated value.

      Available in OS X v10.5 and later.

    • kIOHIDElementCalibrationSaturationMaxKey

      kIOHIDElementCalibrationSaturationMaxKey

      The maximum tolerance to be used when calibrating a logical element value.

      The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element.

      Available in OS X v10.5 and later.

    • kIOHIDElementCalibrationSaturationMinKey

      kIOHIDElementCalibrationSaturationMinKey

      The mininum tolerance to be used when calibrating a logical element value.

      The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element.

      Available in OS X v10.5 and later.

    • kIOHIDElementCookieKey

      kIOHIDElementCookieKey

      Keys that represent properties of a particular elements.

      These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements.

      Available in OS X v10.0 and later.

    • kIOHIDElementCookieMinKey

      kIOHIDElementCookieMinKey

      Keys used for matching particular elements.

      These keys should only be used with a matching dictionary when searching for elements via copyMatchingElements.

      Available in OS X v10.5 and later.

    • kIOHIDElementKey

      kIOHIDElementKey

      Keys that represents an element property.

      Property for a HID Device or element dictionary. Elements can be heirarchical, so they can contain other elements.

      Available in OS X v10.0 and later.

    • kIOHIDTransportKey

      kIOHIDTransportKey

      Keys that represent properties of a paticular device.

      Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices.

      Please note:

      kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching.

      Thus we have added 3 additional keys:

      • kIOHIDDeviceUsageKey

      • kIOHIDDeviceUsagePageKey

      • kIOHIDDeviceUsagePairsKey

      kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device.

      An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary.

      Available in OS X v10.0 and later.

    Import Statement

  • Describes different types of HID collections.

    Declaration

    Objective-C

    enum IOHIDElementCollectionType { kIOHIDElementCollectionTypePhysical = 0x00, kIOHIDElementCollectionTypeApplication, kIOHIDElementCollectionTypeLogical, kIOHIDElementCollectionTypeReport, kIOHIDElementCollectionTypeNamedArray, kIOHIDElementCollectionTypeUsageSwitch, kIOHIDElementCollectionTypeUsageModifier }; typedef enum IOHIDElementCollectionType IOHIDElementCollectionType;

    Constants

    • kIOHIDElementCollectionTypePhysical

      kIOHIDElementCollectionTypePhysical

      Used for a set of data items that represent data points collected at one geometric point.

      Available in OS X v10.3 and later.

    • kIOHIDElementCollectionTypeApplication

      kIOHIDElementCollectionTypeApplication

      Identifies item groups serving different purposes in a single device.

      Available in OS X v10.3 and later.

    • kIOHIDElementCollectionTypeLogical

      kIOHIDElementCollectionTypeLogical

      Used when a set of data items form a composite data structure.

      Available in OS X v10.3 and later.

    • kIOHIDElementCollectionTypeReport

      kIOHIDElementCollectionTypeReport

      Wraps all the fields in a report.

      Available in OS X v10.3 and later.

    • kIOHIDElementCollectionTypeNamedArray

      kIOHIDElementCollectionTypeNamedArray

      Contains an array of selector usages.

      Available in OS X v10.3 and later.

    • kIOHIDElementCollectionTypeUsageSwitch

      kIOHIDElementCollectionTypeUsageSwitch

      Modifies the meaning of the usage it contains.

      Available in OS X v10.3 and later.

    • kIOHIDElementCollectionTypeUsageModifier

      kIOHIDElementCollectionTypeUsageModifier

      Modifies the meaning of the usage attached to the encompassing collection.

      Available in OS X v10.3 and later.

    Discussion

    Collections identify a relationship between two or more elements.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

  • Describes different types of HID elements.

    Declaration

    Objective-C

    enum IOHIDElementType { kIOHIDElementTypeInput_Misc = 1, kIOHIDElementTypeInput_Button = 2, kIOHIDElementTypeInput_Axis = 3, kIOHIDElementTypeInput_ScanCodes = 4, kIOHIDElementTypeOutput = 129, kIOHIDElementTypeFeature = 257, kIOHIDElementTypeCollection = 513 }; typedef enum IOHIDElementType IOHIDElementType;

    Constants

    • kIOHIDElementTypeInput_Misc

      kIOHIDElementTypeInput_Misc

      Misc input data field or varying size.

      Available in OS X v10.0 and later.

    • kIOHIDElementTypeInput_Button

      kIOHIDElementTypeInput_Button

      One bit input data field.

      Available in OS X v10.0 and later.

    • kIOHIDElementTypeInput_Axis

      kIOHIDElementTypeInput_Axis

      Input data field used to represent an axis.

      Available in OS X v10.0 and later.

    • kIOHIDElementTypeInput_ScanCodes

      kIOHIDElementTypeInput_ScanCodes

      Input data field used to represent a scan code or usage selector.

      Available in OS X v10.0 and later.

    • kIOHIDElementTypeOutput

      kIOHIDElementTypeOutput

      Used to represent an output data field in a report.

      Available in OS X v10.0 and later.

    • kIOHIDElementTypeFeature

      kIOHIDElementTypeFeature

      Describes input and output elements not intended for consumption by the end user.

      Available in OS X v10.0 and later.

    • kIOHIDElementTypeCollection

      kIOHIDElementTypeCollection

      Element used to identify a relationship between two or more elements.

      Available in OS X v10.0 and later.

    Discussion

    Used by the IOHIDFamily to identify the type of element processed. Represented by the key kIOHIDElementTypeKey in the dictionary describing the element.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

  • Options for opening a device via IOHIDLib.

    Declaration

    Objective-C

    enum { kIOHIDOptionsTypeNone = 0x00, kIOHIDOptionsTypeSeizeDevice = 0x01 }; typedef uint32_t IOHIDOptionsType;

    Constants

    • kIOHIDOptionsTypeNone

      kIOHIDOptionsTypeNone

      Default option.

      Available in OS X v10.3 and later.

    • kIOHIDOptionsTypeSeizeDevice

      kIOHIDOptionsTypeSeizeDevice

      Used to open exclusive communication with the device. This will prevent the system and other clients from receiving events from the device.

      Available in OS X v10.3 and later.

    Import Statement

    Availability

    Available in OS X v10.3 and later.

  • Options for creating a queue via IOHIDLib.

    Declaration

    Objective-C

    enum { kIOHIDQueueOptionsTypeNone = 0x00, kIOHIDQueueOptionsTypeEnqueueAll = 0x01 }; typedef uint32_t IOHIDQueueOptionsType;

    Constants

    • kIOHIDQueueOptionsTypeNone

      kIOHIDQueueOptionsTypeNone

      Default option.

      Available in OS X v10.5 and later.

    • kIOHIDQueueOptionsTypeEnqueueAll

      kIOHIDQueueOptionsTypeEnqueueAll

      Force the IOHIDQueue to enqueue all events, relative or absolute, regardless of change.

      Available in OS X v10.5 and later.

    Import Statement

    Availability

    Available in OS X v10.5 and later.

  • Describes different type of HID reports.

    Declaration

    Objective-C

    enum IOHIDReportType { kIOHIDReportTypeInput = 0, kIOHIDReportTypeOutput, kIOHIDReportTypeFeature, kIOHIDReportTypeCount }; typedef enum IOHIDReportType IOHIDReportType;

    Constants

    • kIOHIDReportTypeInput

      kIOHIDReportTypeInput

      Input report.

      Available in OS X v10.0 and later.

    • kIOHIDReportTypeOutput

      kIOHIDReportTypeOutput

      Output report.

      Available in OS X v10.0 and later.

    • kIOHIDReportTypeFeature

      kIOHIDReportTypeFeature

      Feature report.

      Available in OS X v10.0 and later.

    Discussion

    Used by the IOHIDFamily to identify the type of report being processed.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

  • Type to define what industrial standard the device is referencing.

    Declaration

    Objective-C

    enum { kIOHIDStandardTypeANSI = 0, kIOHIDStandardTypeISO = 1, kIOHIDStandardTypeJIS = 2 }; typedef uint32_t IOHIDStandardType;

    Constants

    • kIOHIDStandardTypeANSI

      kIOHIDStandardTypeANSI

      ANSI.

      Available in OS X v10.7 and later.

    • kIOHIDStandardTypeISO

      kIOHIDStandardTypeISO

      ISO.

      Available in OS X v10.7 and later.

    • kIOHIDStandardTypeJIS

      kIOHIDStandardTypeJIS

      JIS.

      Available in OS X v10.7 and later.

    Import Statement

    Availability

    Available in OS X v10.7 and later.

  • Describes options for gathering element values.

    Declaration

    Objective-C

    enum { kIOHIDValueOptionsFlagRelativeSimple = ( 1<<0) }; typedef uint32_t IOHIDValueOptions;

    Constants

    • kIOHIDValueOptionsFlagSimpleRelative

      kIOHIDValueOptionsFlagSimpleRelative

      Compares against previous value

    Import Statement

    Availability

    Available in OS X v10.9 and later.

  • Describes different types of scaling that can be performed on element values.

    Declaration

    Objective-C

    enum { kIOHIDValueScaleTypeCalibrated, kIOHIDValueScaleTypePhysical }; typedef uint32_t IOHIDValueScaleType;

    Constants

    • kIOHIDValueScaleTypeCalibrated

      kIOHIDValueScaleTypeCalibrated

      Type for value that is scaled with respect to the calibration properties.

      Available in OS X v10.5 and later.

    • kIOHIDValueScaleTypePhysical

      kIOHIDValueScaleTypePhysical

      Type for value that is scaled with respect to the physical min and physical max of the element.

      Available in OS X v10.5 and later.

    Import Statement

    Availability

    Available in OS X v10.5 and later.