A service that parses HID report data into elements that you can use to dispatch events.
- DriverKit 19.0+
IOUser when you want to process incoming data from a HID device before dispatching it to the system. An event service collects the report from a device, parses it into individual data elements, and dispatches events based on the information in those elements. Create a custom event service when you need to synthesize custom event data, or when you need to process the existing data before dispatching the corresponding events.
To implement a custom event service, override the
handle method and use it to iterate over the report contents and dispatch any relevant events. To get the report data, call the
get method each time a new report arrives. (Also call that method in your service's
Start method to create the elements initially.) The method returns a set of
IOHIDElement objects that contain a parsed version of the report data. Each time you call the method, the system updates the elements to incorporate the data from the latest report.
Specify the Driver's Personality Information
When you subclass
IOUser, update the
IOKit key of your driver extension's
Info file with information to match your driver to appropriate hardware. For this class, always include the keys and values in the following table.
You may add other keys to assist with the matching process. For example, you might include the
Primary 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.