<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHID",
  "identifier" : "/documentation/CoreHID/HIDVirtualDevice/dispatchInputReport(data:timestamp:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core HID"
    ],
    "preciseIdentifier" : "s:7CoreHID16HIDVirtualDeviceC19dispatchInputReport4data9timestampy10Foundation4DataV_12_Concurrency15SuspendingClockV7InstantVtYaKF"
  },
  "title" : "dispatchInputReport(data:timestamp:)"
}
-->

# dispatchInputReport(data:timestamp:)

Dispatch an input report to the system.

```
func dispatchInputReport(data: Data, timestamp: SuspendingClock.Instant) async throws
```

## Parameters

`data`

The bytes to send as a part of the input report. Determining the correct values can be aided by referencing the device’s report descriptor.
If there are multiple reports, the first byte should be the report ID.

`timestamp`

The time that the report originated.

## Discussion

This dispatches an input report to the system, as if a person is interacting with a physical control. For example, if the virtual device represents a keyboard, a keyboard report can be dispatched here to simulate a person pressing a key on the keyboard. The system receives the report and any [`HIDDeviceClient`](/documentation/CoreHID/HIDDeviceClient) devices monitoring for such activity. [`activate(delegate:)`](/documentation/CoreHID/HIDVirtualDevice/activate(delegate:)) must run successfully before this function runs.

> Throws: ``doc://com.apple.CoreHID/documentation/CoreHID/HIDDeviceError`` if there is an issue with the request.

---

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)