<!--
{
  "availability" : [
    "DriverKit: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "HIDDriverKit",
  "identifier" : "/documentation/HIDDriverKit/IOHIDElement",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HIDDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOHIDElement"
  },
  "title" : "IOHIDElement"
}
-->

# IOHIDElement

An object that contains parsed information from a HID input report.

```
class IOHIDElement;
```

## Overview

An `IOHIDElement` object contains details about a particular aspect of a HID-related input report. After receiving an input report from a HID device, `IOUserHIDEventService` and `IOHIDInterface` objects divide the report details into `IOHIDElement` objects for easier management. You use these element objects to obtain details about the report, such as the current value reported by the device, how that value is meant to be used, and the minimum and maximum values. For example, a report from a mouse usually contains separate elements for the mouse’s x and y positions.

You don’t create `IOHIDElement` objects directly. Instead, use the `getElements` method of your [`IOUserHIDEventService`](/documentation/HIDDriverKit/IOUserHIDEventService) or [`IOHIDInterface`](/documentation/HIDDriverKit/IOHIDInterface) object to fetch the elements associated with the latest report. Each time you call that method, the corresponding object updates the element data using the most recent report.

## Topics

### Getting an Element’s Usage Information

[`virtual uint32_t getUsagePage();`](/documentation/HIDDriverKit/IOHIDElement/getUsagePage)

[`virtual uint32_t getUsage();`](/documentation/HIDDriverKit/IOHIDElement/getUsage)

### Accessing the Element’s Value

[`virtual uint32_t getValue(IOOptionBits options);`](/documentation/HIDDriverKit/IOHIDElement/getValue)

Gets the logical value that the device reported.

[`virtual OSData * getDataValue(IOOptionBits options);`](/documentation/HIDDriverKit/IOHIDElement/getDataValue)

Gets the data value.

[`virtual uint32_t getScaledValue(IOHIDValueScaleType type);`](/documentation/HIDDriverKit/IOHIDElement/getScaledValue)

Returns a scaled version of the logical value.

[`virtual IOFixed getScaledFixedValue(IOHIDValueScaleType type);`](/documentation/HIDDriverKit/IOHIDElement/getScaledFixedValue)

Returns a fixed number that represents the scaled version of the element’s logical value.

[`virtual void setValue(uint32_t value);`](/documentation/HIDDriverKit/IOHIDElement/setValue)

Sets the value of the element.

[`virtual void setDataValue(OSData *value);`](/documentation/HIDDriverKit/IOHIDElement/setDataValue)

Sets the data value of the element.

[`virtual uint32_t getUnit();`](/documentation/HIDDriverKit/IOHIDElement/getUnit)

Returns the units that you use to interpret the element’s value.

[`virtual uint32_t getUnitExponent();`](/documentation/HIDDriverKit/IOHIDElement/getUnitExponent)

Returns the exponent that you use to interpret the element’s value.

[`typedef uint32_t IOHIDValueOptions;`](/documentation/HIDDriverKit/IOHIDValueOptions)

A type for specifying value-related options.

[Value Options](/documentation/HIDDriverKit/Value-Options-enum)

Options for how to retrieve an element’s values.

[`typedef uint32_t IOHIDValueScaleType;`](/documentation/HIDDriverKit/IOHIDValueScaleType)

The type of scaling to use for an element’s value.

[Value Scale Types](/documentation/HIDDriverKit/Value-Scale-Types-enum)

The different types of scaling that you can perform on element values.

### Getting Minimum and Maximum Values

[`virtual uint32_t getLogicalMin();`](/documentation/HIDDriverKit/IOHIDElement/getLogicalMin)

[`virtual uint32_t getLogicalMax();`](/documentation/HIDDriverKit/IOHIDElement/getLogicalMax)

[`virtual uint32_t getPhysicalMin();`](/documentation/HIDDriverKit/IOHIDElement/getPhysicalMin)

[`virtual uint32_t getPhysicalMax();`](/documentation/HIDDriverKit/IOHIDElement/getPhysicalMax)

### Getting the Element’s Timestamp

[`virtual uint64_t getTimeStamp();`](/documentation/HIDDriverKit/IOHIDElement/getTimeStamp)

### Managing the Element Hierarchy

[`virtual IOHIDElementType getType();`](/documentation/HIDDriverKit/IOHIDElement/getType)

[`virtual IOHIDElementCollectionType getCollectionType();`](/documentation/HIDDriverKit/IOHIDElement/getCollectionType)

[`virtual OSArray * getChildElements();`](/documentation/HIDDriverKit/IOHIDElement/getChildElements)

[`virtual IOHIDElement * getParentElement();`](/documentation/HIDDriverKit/IOHIDElement/getParentElement)

[`enum IOHIDElementType : unsigned int;`](/documentation/HIDDriverKit/IOHIDElementType)

The types of HID elements that you can examine.

[`enum IOHIDElementCollectionType : unsigned int;`](/documentation/HIDDriverKit/IOHIDElementCollectionType)

Constants that indicate the types of relationships that exist between two or more elements.

### Getting Report Information

[`virtual uint32_t getReportID();`](/documentation/HIDDriverKit/IOHIDElement/getReportID)

[`virtual uint32_t getReportCount();`](/documentation/HIDDriverKit/IOHIDElement/getReportCount)

[`virtual uint32_t getReportSize();`](/documentation/HIDDriverKit/IOHIDElement/getReportSize)

[`enum IOHIDReportType : unsigned int;`](/documentation/HIDDriverKit/IOHIDReportType)

Describes the different types of HID reports.

### Identifying the Element

[`virtual IOHIDElementCookie getCookie();`](/documentation/HIDDriverKit/IOHIDElement/getCookie)

[`typedef uint32_t IOHIDElementCookie;`](/documentation/HIDDriverKit/IOHIDElementCookie)

A type that an element uses to distinguish itself from other elements.

### Getting the Element Flags

[`virtual uint32_t getFlags();`](/documentation/HIDDriverKit/IOHIDElement/getFlags)

[`typedef uint32_t IOHIDElementFlags;`](/documentation/HIDDriverKit/IOHIDElementFlags)

[HID Element Flags](/documentation/HIDDriverKit/HID-Element-Flags-enum)

### Committing Changes to Elements

[`virtual IOReturn commit(IOHIDElementCommitDirection direction);`](/documentation/HIDDriverKit/IOHIDElement/commit)

Commits the element value to and from the device.

[`typedef enum { ... } IOHIDElementCommitDirection;`](/documentation/HIDDriverKit/IOHIDElementCommitDirection)

The commit direction for an HID element.

### Instance Methods

[`virtual bool conformsTo(uint32_t usagePage, uint32_t usage);`](/documentation/HIDDriverKit/IOHIDElement/conformsTo)

## Relationships

### Inherits From

[`OSContainer`](/documentation/DriverKit/OSContainer)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)