diff options
| author | Tomáš Znamenáček | 2015-01-08 12:00:53 +0100 |
|---|---|---|
| committer | Tomáš Znamenáček | 2015-01-08 12:00:53 +0100 |
| commit | 9b919cba51e4cd11b0c4424930d6c18a1baec73c (patch) | |
| tree | a8107774609d5f4263f7b79749d93e6c6ff2642d /Framework/MASShortcutMonitor.h | |
| parent | a3a459b4e4e47bf18dccd5dc7f315389346e3d6c (diff) | |
| parent | ea69d5939511f61a7082ba1e8ff46d247862a3fa (diff) | |
| download | MASShortcut-9b919cba51e4cd11b0c4424930d6c18a1baec73c.tar.bz2 | |
Merge pull request #53 from zoul/2.0-candidate
Thank you very much!
Diffstat (limited to 'Framework/MASShortcutMonitor.h')
| -rw-r--r-- | Framework/MASShortcutMonitor.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Framework/MASShortcutMonitor.h b/Framework/MASShortcutMonitor.h new file mode 100644 index 0000000..609686a --- /dev/null +++ b/Framework/MASShortcutMonitor.h @@ -0,0 +1,27 @@ +#import "MASShortcut.h" + +/** + @brief Executes action when a shortcut is pressed. + + There can only be one instance of this class, otherwise things + will probably not work. (There’s a Carbon event handler inside + and there can only be one Carbon event handler of a given type.) +*/ +@interface MASShortcutMonitor : NSObject + +- (instancetype) init __unavailable; ++ (instancetype) sharedMonitor; + +/** + @brief Register a shortcut along with an action. + + Attempting to insert an already registered shortcut probably won’t work. + It may burn your house or cut your fingers. You have been warned. +*/ +- (void) registerShortcut: (MASShortcut*) shortcut withAction: (dispatch_block_t) action; +- (BOOL) isShortcutRegistered: (MASShortcut*) shortcut; + +- (void) unregisterShortcut: (MASShortcut*) shortcut; +- (void) unregisterAllShortcuts; + +@end |
