<!--
{
  "availability" : [
    "driverkit: 19.0.0 -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "HIDDriverKit",
  "identifier" : "/documentation/HIDDriverKit/IOHIDInterface/getElements",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HIDDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOHIDInterface@F@getElements#"
  },
  "title" : "getElements"
}
-->

# getElements

Returns the array of elements that the interface uses to store  parsed report data.

```
virtual OSArray * getElements();
```

## Return Value

An array of [`IOHIDElement`](/documentation/HIDDriverKit/IOHIDElement) objects containing the parsed data from the report.

## Discussion

This method returns the array of [`IOHIDElement`](/documentation/HIDDriverKit/IOHIDElement) objects associated with the interface. Each element contains data for a single aspect of the device’s state. For example, a report from a stylus contains separate elements for the horizontal and vertical position of the stylus, the pressure values, and so on. Use the [`getUsagePage`](/documentation/HIDDriverKit/IOHIDElement/getUsagePage) and [`getUsage`](/documentation/HIDDriverKit/IOHIDElement/getUsage) methods of the element to determine the type of information in each element.

This method creates a new set of `IOHIDElement` objects the first time you call it, but it doesn’t update the contents of each element automatically. Call the [`processReport`](/documentation/HIDDriverKit/IOHIDInterface/processReport) method to update the contents of the elements before using this method to retrieve them.

---

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)