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

# getElements

Returns an array of elements that contain the parsed data from the HID device’s report.

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

## Return Value

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

## Discussion

Use this method to get the array of [`IOHIDElement`](/documentation/HIDDriverKit/IOHIDElement) objects that contain the data for the most recent device report. 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`](/documentation/HIDDriverKit/IOHIDElement) objects the first time you call it. On subequent calls, it updates the existing [`IOHIDElement`](/documentation/HIDDriverKit/IOHIDElement) objects with data from the most recent report.

---

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)