From fe750267fb4942e91a106e136aadb110c4a0b8e4 Mon Sep 17 00:00:00 2001 From: Vadim Shpakovski Date: Wed, 19 Sep 2012 13:25:29 +0300 Subject: Improves README. --- README.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f5861d3..7d75a6e 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,13 @@ Some time ago Cocoa developers used a brilliant framework [ShortcutRecorder](htt The project MASShortcut introduces modern API and user interface for recording, storing and using global keyboard shortcuts. All code is compatible with Xcode 4.3, Mac OS X 10.7 and the sandboxed environment. -# Usage +# Usage for the branch ‘32-bit’ -I hope, it is really easy: + // Make a raw keyboard shortcut + MASShortcut *shortcut = [MASShortcut shortcutWithKeyCode:kVK_F1 modifierFlags:NSCommandKeyMask]; - // 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:^{ + // Execute your block of code automatically when user triggers a shortcut + [MASShortcut addGlobalHotkeyMonitorWithShortcut:shortcut handler:^{ // Let me know if you find a better or more convenient API. }]; -- cgit v1.2.3