IOUserHIDEventDriver
A complete driver object that dispatches keyboard, digitizer, scrolling, and pointer events originating from a HID device.
Declaration
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 and customize how your event service processes the report data.
Specify the Driver’s Personality Information
When you subclass 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 |
|---|---|
| The value |
| The provider class information. For HID interfaces, specify Iohidinterface. |
| The name of your custom subclass. |
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
Parsing the Element Hierarchy
parseElementsparsePointerElementparseDigitizerElementparseKeyboardElementparseScrollElementparseLEDElement
Handling New Data Reports
handleReporthandleKeyboardReporthandleRelativePointerReporthandleAbsolutePointerReporthandleScrollReporthandleDigitizerReportcreateEventForDigitizerCollection
Configuring LED Lights
Configuring Private Properties
Instance Methods
SetPropertiescalibrateCenteredPreferredStateElementcalibrateJustifiedPreferredStateElementcheckGameControllerElementcopyKeyboardEventgetButtonStateFromElementshandleCopyMatchingEventhandleGameControllerReporthandleProximityReportparseElementparseGameControllerElementparseProximityElementparseRemainingElementparseRemainingElementspostProcessElementspostProcessElements_internalprocessDigitizerElementsprocessGameControllerElementssetDigitizerPropertiessetGameControllerPropertiessetKeyboardPropertiessetLEDPropertiessetRelativePropertiessetScrollProperties