diff options
| -rw-r--r-- | README.md | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -1,12 +1,29 @@ -# MASShortcut +# Introduction -Prior to Xcode 4 we used the framework [ShortcutRecorder](http://wafflesoftware.net/shortcut/). However, it is incompatible with a new plugin architecture. +We used a brilliant framework [ShortcutRecorder](http://wafflesoftware.net/shortcut/) for managing keyboard shortcuts in application preferences. However, it became incompatible with a new plugin architecture of Xcode 4. -This set of classes is a modern interface for recording and storing global keyboard shortcuts. The repository has ARC-enabled Objective-C code compatible with OS X 10.8 and its sandboxed environment. Enjoy! +The project MASShortcut introduces modern API and user interface for recording, storing and using global keyboard shortcuts. All code is compatible with OS X 10.7 and the sandboxed environment. # How to use -You can find a Demo project at [MASShortcutDemo](https://github.com/shpakovski/MASShortcutDemo). +I hope, it is really easy: + + // Drop a custom view into XIB and set its class to MASShortcutView + @property (nonatomic, weak) IBOutlet MASShortcutView *shortcutView; + + // Think up a preference key to store a global shortcut between launches + NSString *const kPreferenceGlobalShortcut = @"GlobalShortcut"; + + // Assign the preference key and the shortcut view will take care of persistence + self.shortcutView.associatedUserDefaultsKey = kPreferenceGlobalShortcut; + + // Execute your block of code automatically when user triggers a shortcut from preferences + [MASShortcut registerGlobalShortcutWithUserDefaultsKey:kPreferenceGlobalShortcut handler:^{ + + // Let me know if you find a better or more convenient API. + }]; + +To set an example, I made a demo project: [MASShortcutDemo](https://github.com/shpakovski/MASShortcutDemo). Enjoy! # License |
