Introduction to Working With HID Class Device Interfaces

What Are HID Class Device Interfaces?

The device interface mechanism supported by the I/O Kit gives applications the ability to communicate with hardware from outside the kernel. This document describes how to use the device interface provided by the Human Interface Device (HID) family to access HID class devices (such as keyboards, mice, and uninterruptible power supplies) from applications running on OS X.

Who Should Read This Document?

You should read this document if you are an application developer who needs to write custom code to communicate with a HID class device from user space.

Organization of This Document

The document is divided into two main chapters:

Although the sample code in this document has been checked for accuracy, it is not intended to meet the needs of a commercial application. For example, error handling is minimal and simply facilitates debugging of this code—you should develop your own techniques for detecting and handling errors. Therefore Apple does not recommend that you directly incorporate the entire sample program into a commercial application.

See Also

This document assumes you are familiar with the general I/O Kit and device interface information presented in Accessing Hardware From Applications. In particular, for definitions of I/O Kit terms used in this document such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts in the chapter Accessing Hardware From Applications.

A detailed description of the HID class specification is beyond the scope of this document—for more information, including the complete listing of HID usage tables, visit the USB website at http://www.usb.org.

For API documentation, see the IOHIDLib.h and IOHIDKeys.h entries in I/O Kit Framework Reference.