<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHID",
  "identifier" : "/documentation/CoreHID/HIDVirtualDeviceDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Core HID"
    ],
    "preciseIdentifier" : "s:7CoreHID24HIDVirtualDeviceDelegateP"
  },
  "title" : "HIDVirtualDeviceDelegate"
}
-->

# HIDVirtualDeviceDelegate

The delegate to receive notifications for a virtual HID device.

```
protocol HIDVirtualDeviceDelegate : Sendable
```

## Overview

A delegate must be created and provided to [`activate(delegate:)`](/documentation/CoreHID/HIDVirtualDevice/activate(delegate:)) during activation of a virtual HID device. This delegate receives notifications intended for the device, such as a get report request from a client. One delegate can be used for many devices.

## Topics

### Receive notifications for a device

[`func hidVirtualDevice(HIDVirtualDevice, receivedSetReportRequestOfType: HIDReportType, id: HIDReportID?, data: Data) async throws`](/documentation/CoreHID/HIDVirtualDeviceDelegate/hidVirtualDevice(_:receivedSetReportRequestOfType:id:data:))

A notification that a set report request has been received from the system.

[`func hidVirtualDevice(HIDVirtualDevice, receivedGetReportRequestOfType: HIDReportType, id: HIDReportID?, maxSize: Int) async throws -> Data`](/documentation/CoreHID/HIDVirtualDeviceDelegate/hidVirtualDevice(_:receivedGetReportRequestOfType:id:maxSize:))

A notification that a get report request has been received from the system.

## Relationships

### Inherits From

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)