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:
HID Explorer—A Cocoa application that demonstrates how to use the HID Manager APIs while providing a useful tool for exploring the HID devices attached to your computer.
HID Config Save—A Carbon application that demonstrates how to save and restore element configuration information and shows how to use the configured inputs in a game environment.
HID Calibrator—A Carbon application that demonstrates the HID Manager APIs..
HID LED test tool—A command-line tool that demonstrates how to iterate HID devices and manipulate their LEDs.
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.
Copyright © 2001, 2009 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2009-10-19