diff options
| author | Paulo F. Andrade | 2014-09-17 16:47:37 +0100 |
|---|---|---|
| committer | Paulo F. Andrade | 2014-09-17 16:47:37 +0100 |
| commit | 724376092de61df8cb90b5b5d81ae0c30bcd1b24 (patch) | |
| tree | 7f62cd0891ef21504407f01b91b5e0877b9ae00e | |
| parent | da2773633059df112bd3c25fc8ae633f73c9f42b (diff) | |
| parent | a5c2e159354c8474579d96971a9103f3f11c1e39 (diff) | |
| download | MASShortcut-724376092de61df8cb90b5b5d81ae0c30bcd1b24.tar.bz2 | |
Updated MASShortcut
| -rw-r--r-- | MASShortcut.h | 1 | ||||
| -rw-r--r-- | MASShortcut.m | 4 | ||||
| -rw-r--r-- | MASShortcut.podspec | 13 | ||||
| -rw-r--r-- | MASShortcutView.h | 2 | ||||
| -rw-r--r-- | MASShortcutView.m | 2 |
5 files changed, 20 insertions, 2 deletions
diff --git a/MASShortcut.h b/MASShortcut.h index 515d659..c9081a2 100644 --- a/MASShortcut.h +++ b/MASShortcut.h @@ -1,4 +1,5 @@ #import <Carbon/Carbon.h> +#import <AppKit/AppKit.h> #define MASShortcutChar(char) [NSString stringWithFormat:@"%C", (unsigned short)(char)] #define MASShortcutClear(flags) (flags & (NSControlKeyMask | NSShiftKeyMask | NSAlternateKeyMask | NSCommandKeyMask)) diff --git a/MASShortcut.m b/MASShortcut.m index 8790ac6..b217a98 100644 --- a/MASShortcut.m +++ b/MASShortcut.m @@ -327,9 +327,11 @@ BOOL MASShortcutAllowsAnyHotkeyWithOptionModifier = NO; CFDictionaryRef hotKeyInfo = CFArrayGetValueAtIndex(globalHotKeys, i); CFNumberRef code = CFDictionaryGetValue(hotKeyInfo, kHISymbolicHotKeyCode); CFNumberRef flags = CFDictionaryGetValue(hotKeyInfo, kHISymbolicHotKeyModifiers); + CFNumberRef enabled = CFDictionaryGetValue(hotKeyInfo, kHISymbolicHotKeyEnabled); if (([(__bridge NSNumber *)code unsignedIntegerValue] == self.keyCode) && - ([(__bridge NSNumber *)flags unsignedIntegerValue] == self.carbonFlags)) { + ([(__bridge NSNumber *)flags unsignedIntegerValue] == self.carbonFlags) && + ([(__bridge NSNumber *)enabled boolValue])) { if (outError) { NSString *description = NSLocalizedString(@"This combination cannot be used because it is already used by a system-wide " diff --git a/MASShortcut.podspec b/MASShortcut.podspec new file mode 100644 index 0000000..22afc6b --- /dev/null +++ b/MASShortcut.podspec @@ -0,0 +1,13 @@ +Pod::Spec.new do |s| + s.name = 'MASShortcut' + s.version = '1.2.3' + s.summary = 'Modern framework for managing global keyboard shortcuts compatible with Mac App Store' + s.homepage = 'https://github.com/sonoramac/MASShortcut' + s.authors = { 'Vadim Shpakovski' => 'vadim@shpakovski.com' } + s.license = 'BSD 2-clause' + + s.source = { :git => 'git@github.com:shpakovski/MASShortcut.git', :tag => '1.2.3' } + s.source_files = '*.{h,m}' + s.framework = 'Carbon' + s.requires_arc = true +end diff --git a/MASShortcutView.h b/MASShortcutView.h index 13163d4..d6a4313 100644 --- a/MASShortcutView.h +++ b/MASShortcutView.h @@ -1,3 +1,5 @@ +#import <AppKit/AppKit.h> + @class MASShortcut; typedef enum { diff --git a/MASShortcutView.m b/MASShortcutView.m index 17ad0f1..f4eb8ff 100644 --- a/MASShortcutView.m +++ b/MASShortcutView.m @@ -359,7 +359,7 @@ void *kUserDataHint = &kUserDataHint; weakSelf.recording = NO; event = nil; } - else if (shortcut.keyCode == kVK_Escape) { + else if (shortcut.keyCode == kVK_Escape && !shortcut.modifierFlags) { // Cancel recording weakSelf.recording = NO; event = nil; |
