aboutsummaryrefslogtreecommitdiffstats
path: root/Framework/MASShortcutMonitor.m
diff options
context:
space:
mode:
authorJason Perkins2015-02-16 10:09:48 -0500
committerJason Perkins2015-02-16 10:09:48 -0500
commit86d5b1ae49105c1b0a789cbdac17dd7ce0da0479 (patch)
tree58f9e363bd64e9a667e35b990655093481bbf64e /Framework/MASShortcutMonitor.m
parentb564f5296a489d83d0007b8b21185c5b3326dbc8 (diff)
parent3ea350cec127d7118ef64f0e84a9ad84fa249a11 (diff)
downloadMASShortcut-86d5b1ae49105c1b0a789cbdac17dd7ce0da0479.tar.bz2
Merge branch 'master' into issue-47-accessibility
Diffstat (limited to 'Framework/MASShortcutMonitor.m')
-rw-r--r--Framework/MASShortcutMonitor.m11
1 files changed, 8 insertions, 3 deletions
diff --git a/Framework/MASShortcutMonitor.m b/Framework/MASShortcutMonitor.m
index 099f4b1..fce8022 100644
--- a/Framework/MASShortcutMonitor.m
+++ b/Framework/MASShortcutMonitor.m
@@ -45,11 +45,16 @@ static OSStatus MASCarbonEventCallback(EventHandlerCallRef, EventRef, void*);
#pragma mark Registration
-- (void) registerShortcut: (MASShortcut*) shortcut withAction: (dispatch_block_t) action
+- (BOOL) registerShortcut: (MASShortcut*) shortcut withAction: (dispatch_block_t) action
{
MASHotKey *hotKey = [MASHotKey registeredHotKeyWithShortcut:shortcut];
- [hotKey setAction:action];
- [_hotKeys setObject:hotKey forKey:shortcut];
+ if (hotKey) {
+ [hotKey setAction:action];
+ [_hotKeys setObject:hotKey forKey:shortcut];
+ return YES;
+ } else {
+ return NO;
+ }
}
- (void) unregisterShortcut: (MASShortcut*) shortcut