<!--
{
  "availability" : [
    "DriverKit: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "HIDDriverKit",
  "identifier" : "/documentation/HIDDriverKit/IOUserHIDEventDriver",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HIDDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserHIDEventDriver"
  },
  "title" : "IOUserHIDEventDriver"
}
-->

# IOUserHIDEventDriver

A complete driver object that dispatches keyboard, digitizer, scrolling, and pointer events originating from a HID device.

```
class IOUserHIDEventDriver;
```

## Overview

An `IOUserHIDEventDriver` object is a fully functional driver that handles many common types of HID events. This driver parses incoming reports and uses the information to dispatch many types of events to the system. Apple provides this driver object as a default implementation for devices that conform to the HID specifications and don’t include any custom information that requires a special driver.

You can subclass `IOUserHIDEventDriver` and add support for other types of events. Alternatively, you can subclass [`IOUserHIDEventService`](/documentation/HIDDriverKit/IOUserHIDEventService) and customize how your event service processes the report data.

### Specify the Driver’s Personality Information

When you subclass [`IOUserHIDEventDriver`](/documentation/HIDDriverKit/IOUserHIDEventDriver), update the `IOKitPersonalities` key of your driver extension’s `Info.plist` file with information to match your driver to appropriate hardware. For this class, always include the keys and values in the following table.

|Key                                                                                                       |Discussion                                                                                                                             |
|----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
|`IOClass`                                                                                                 |The value `AppleUserHIDEventService`.                                                                                                  |
|`IOProviderClass`                                                                                         |The provider class information. For HID interfaces, specify ``doc://com.apple.hiddriverkit/documentation/HIDDriverKit/IOHIDInterface``.|
|`IOUserClass`                                                                                             |The name of your custom subclass.                                                                                                      |
|<doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/CFBundleIdentifier>|The bundle identifier of your driver.                                                                                                  |

You may add other keys to assist with the matching process. For example, you might include the `VendorID`, `ProductID`, `PrimaryUsagePage`, and `PrimaryUsage` keys to match against specific USB devices and HID usage types. The USB specification defines which keys to include when matching your driver to a USB device. For information about the specific key combinations, see *Universal Serial Bus Common Class Specification* at <https://www.usb.org>.

## Topics

### Running the Driver

[`virtual bool init();`](/documentation/HIDDriverKit/IOUserHIDEventDriver/init)

Handles the basic initialization of the event service.

[`virtual kern_return_t Start(IOService *provider);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/Start)

Starts the current event driver and associates it with the specified provider object.

[`virtual void free();`](/documentation/HIDDriverKit/IOUserHIDEventDriver/free)

Performs any final cleanup for the service.

### Parsing the Element Hierarchy

[`virtual bool parseElements(OSArray *elements);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseElements)

Parses the specified array of elements.

[`virtual bool parsePointerElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parsePointerElement)

Parses an element to see if it supports pointer usages.

[`virtual bool parseDigitizerElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseDigitizerElement)

Parses an element to see if it supports digitizer usages.

[`virtual bool parseKeyboardElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseKeyboardElement)

Parses an element to see if it contains keyboard-related information.

[`virtual bool parseScrollElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseScrollElement)

Parses an element to see if it supports scroll usages.

[`virtual bool parseLEDElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseLEDElement)

Parses an element to see if it supports LED usages.

### Handling New Data Reports

[`virtual void handleReport(uint64_t timestamp, uint8_t *report, uint32_t reportLength, IOHIDReportType type, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleReport)

Processes the information in a new device report and dispatches any relevant events in response.

[`virtual void handleKeyboardReport(uint64_t timestamp, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleKeyboardReport)

Iterates through keyboard elements and dispatches them if the element value has been updated.

[`virtual void handleRelativePointerReport(uint64_t timestamp, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleRelativePointerReport)

Iterates through relative pointer elements and dispatches them if the element value has been updated.

[`virtual void handleAbsolutePointerReport(uint64_t timestamp, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleAbsolutePointerReport)

Iterates through absolute pointer elements and dispatches them if the element value has been updated.

[`virtual void handleScrollReport(uint64_t timestamp, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleScrollReport)

Iterates through scroll elements and dispatches them if the element value has been updated.

[`virtual void handleDigitizerReport(uint64_t timestamp, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleDigitizerReport)

Processes the digitizer elements and dispatches events for any updated values.

[`IOHIDEvent * createEventForDigitizerCollection(IOHIDDigitizerCollection *collection, uint64_t timestamp, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/createEventForDigitizerCollection)

Creates a HID event object that represents a digitizer collection.

### Configuring LED Lights

[`virtual void SetLED(uint32_t usage, bool on);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/SetLED)

Sets the state of an LED on the device.

### Configuring Private Properties

[`void setAccelerationProperties(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setAccelerationProperties)

[`void setSurfaceDimensions(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setSurfaceDimensions)

[`void setTipThreshold();`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setTipThreshold)

### Instance Methods

[`virtual kern_return_t SetProperties(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/SetProperties)

[`void calibrateCenteredPreferredStateElement(IOHIDElement *element, int32_t removalPercentage);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/calibrateCenteredPreferredStateElement)

[`void calibrateJustifiedPreferredStateElement(IOHIDElement *element, int32_t removalPercentage);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/calibrateJustifiedPreferredStateElement)

[`uint32_t checkGameControllerElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/checkGameControllerElement)

[`IOHIDEvent * copyKeyboardEvent(uint32_t usagePage, uint32_t usage);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/copyKeyboardEvent)

[`uint32_t getButtonStateFromElements(OSArray *elements);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/getButtonStateFromElements)

[`virtual kern_return_t handleCopyMatchingEvent(OSDictionary *matching, IOHIDEvent **event);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleCopyMatchingEvent)

[`virtual void handleGameControllerReport(uint64_t timestamp, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleGameControllerReport)

[`virtual void handleProximityReport(uint64_t timestamp, uint32_t reportID);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/handleProximityReport)

[`virtual bool parseElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseElement)

[`virtual bool parseGameControllerElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseGameControllerElement)

[`virtual bool parseProximityElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseProximityElement)

[`virtual bool parseRemainingElement(IOHIDElement *element);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseRemainingElement)

[`void parseRemainingElements(OSArray *elements);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/parseRemainingElements)

[`virtual bool postProcessElements(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/postProcessElements)

[`bool postProcessElements_internal();`](/documentation/HIDDriverKit/IOUserHIDEventDriver/postProcessElements_internal)

[`void processDigitizerElements();`](/documentation/HIDDriverKit/IOUserHIDEventDriver/processDigitizerElements)

[`void processGameControllerElements();`](/documentation/HIDDriverKit/IOUserHIDEventDriver/processGameControllerElements)

[`void setDigitizerProperties(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setDigitizerProperties)

[`void setGameControllerProperties(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setGameControllerProperties)

[`void setKeyboardProperties(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setKeyboardProperties)

[`void setLEDProperties(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setLEDProperties)

[`void setRelativeProperties(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setRelativeProperties)

[`void setScrollProperties(OSDictionary *properties);`](/documentation/HIDDriverKit/IOUserHIDEventDriver/setScrollProperties)

## Relationships

### Inherits From

[`IOUserHIDEventService`](/documentation/HIDDriverKit/IOUserHIDEventService)

---

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)