Complete Code Samples

The code samples elsewhere in this document are intended to introduce concepts. Thus, this document does not include all the necessary code to build a working tool on its own.

The code samples in this chapter are complete samples that you can run and use as a basis for experimentation.

Current Examples

The following sample code projects show how to use the HID Manager interfaces added in OS X v10.5:

Legacy Examples

The code samples in this section are designed for older versions of OS X (prior to version 10.5). For version 10.5 and later, these APIs are deprecated. You should use the APIs shown in Accessing a HID Device for new code written for OS X v10.5 and later.

The Companion Files disk image contains a complete, buildable version of the example in Legacy HID Access Overview and Working With Legacy HID Class Device Interfaces.

In addition, a second example tool, HIDTestTool, is included. This tool provides additional sample code that may be useful when working with various HID devices.

If you are viewing this document on the web, the disk image can be downloaded by clicking the "Companion Files” link at the top of the table of contents. If you are viewing this document as a PDF file, or if you are viewing it from a local installation, you must first go to the online version of this document at http://developer.apple.com/documentation/DeviceDrivers/Conceptual/HID/index.html.

In addition to these examples, the HID Manager Basics, HID Utilities Source, and UniversalHIDModuleTest sample code projects use these legacy APIs.