summaryrefslogtreecommitdiffstats
path: root/DDHotKeyCenter.h
blob: e1cd603b2fd4ee8a23382c70ef47ac0a7d8b7133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
//  DDHotKeyManager.h
//  EmptyAppKit
//
//  Created by Dave DeLong on 2/20/10.
//  Copyright 2010 Home. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#define BUILD_FOR_SNOWLEOPARD (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)

#if BUILD_FOR_SNOWLEOPARD
typedef void (^DDHotKeyTask)(NSEvent*);
#endif

@interface DDHotKeyCenter : NSObject {

}

- (BOOL) registerHotKeyWithTarget:(id)target action:(SEL)action object:(id)object keyCode:(unsigned short)keyCode modifierFlags:(NSUInteger)flags;

#if BUILD_FOR_SNOWLEOPARD
- (BOOL) registerHotKeyWithBlock:(DDHotKeyTask)task keyCode:(unsigned short)keyCode modifierFlags:(NSUInteger)flags;
#endif

- (BOOL) hasRegisteredHotKeyWithKeyCode:(unsigned short)keyCode modifierFlags:(NSUInteger)flags;
- (void) unregisterHotKeysWithTarget:(id)target;
- (void) unregisterHotKeyWithTarget:(id)target action:(SEL)action;
- (void) unregisterHotKeyWithKeyCode:(unsigned short)keyCode modifierFlags:(NSUInteger)flags;

@end