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

# commit

Commits the element value to and from the device.

```
virtual IOReturn commit(IOHIDElementCommitDirection direction);
```

## Parameters

`direction`

The direction to commit the element. Specify [`kIOHIDElementCommitDirectionIn`](/documentation/HIDDriverKit/IOHIDElementCommitDirection/kIOHIDElementCommitDirectionIn) to read the element data from the device. Specify [`kIOHIDElementCommitDirectionOut`](/documentation/HIDDriverKit/IOHIDElementCommitDirection/kIOHIDElementCommitDirectionOut) to write the element data to the device.

## Return Value

<doc://com.apple.documentation/documentation/DriverKit/kIOReturnSuccess> on success, or another value if an error occurs. See <doc://com.apple.documentation/documentation/DriverKit/error-codes>.

---

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)