Hot keys for the modern cocoa developer.
Objective-C
Latest commit 2dee4b7 Sep 17, 2013 Danny Greg Merge pull request #1 from kastiglione/Werror-fixes
-Werror games
Permalink
Failed to load latest commit information.
.gitignore Yay we need a gitignore now. Jul 10, 2012
DGGHotKey.h
DGGHotKey.m
DGGKeyCodeTranslater.h
DGGKeyCodeTranslater.m Appropriately cast inside +stringForKeycode: Sep 15, 2013
DGGKeyCombo.h Initial addition of files to the public repo. Jun 29, 2012
DGGKeyCombo.m
Readme.md

Readme.md

DGGHotKey

A super-simple, modern interface to system hot keys in cocoa.

Usage

The API, whilst horribly undocumented, is fairly trivial. Create a DGGKeyCombo using a keycode and modifier mask, then register it with a handler block.

Boom! Your block will be invoked whenever the hotkey is pressed.

You are returned an opaque pointer from the registration, hang onto it, you will need it if you wish to unregister the hotkey.

All Cocoa, All the Time

You don't have to worry about Carbon types or constants. For the modifier mask, use the constants defined in NSEvent.h, NSCommandKeyMask and friends.

Dependencies

You need to be linking the Carbon framework in your project.

 Tip of the Hat

This was all inspired by PTHotKey and the superb ShortcutRecorder.

License

Distributed under the MIT license.