|
Version: 1.0 Posted: 2006-02-23 Build Requirements: Xcode 2.2, Universal Binary Runtime Requirements: Mac OS X 10.4 Download Sample (iTunesController.zip, 49.1K) |
||||
DescriptioniTunesController makes use of the RegisterEventHotKey API which allows you to register to receive hotkey events while in the foreground or background. Registering for a hotkey such as <command>-P causes problems because, once registered for a hotkey, that event does NOT get propagated to the frontmost application, and in this case, would intercept it from printing. We overcome this problem, in the routine PostHotKeyKeyboardEvent, by first unregestering for hotkeys, posting the event to the frontmost application using CGPostKeyboardEvent, and then re-registering for hotkeys. This sample also demonstrates how to communicate with iTunes through an AppleScript in our timer routine, PeriodicTimerAction. Builds as a Universal Binary Document Revision History
|
|