PageRenderTime 102ms CodeModel.GetById 41ms app.highlight 3ms RepoModel.GetById 57ms app.codeStats 0ms

/thirdparty/SPMediaKeyTap/SPMediaKeyTap.h

http://github.com/tomahawk-player/tomahawk
C Header | 43 lines | 32 code | 9 blank | 2 comment | 0 complexity | 72f03fb79a3e4cb6ef92ff4a68cd6c05 MD5 | raw file
 1#include <Cocoa/Cocoa.h>
 2#import <IOKit/hidsystem/ev_keymap.h>
 3#import <Carbon/Carbon.h>
 4
 5// http://overooped.com/post/2593597587/mediakeys
 6
 7#define SPSystemDefinedEventMediaKeys 8
 8
 9@interface SPMediaKeyTap : NSObject {
10	EventHandlerRef _app_switching_ref;
11	EventHandlerRef _app_terminating_ref;
12	CFMachPortRef _eventPort;
13	CFRunLoopSourceRef _eventPortSource;
14	CFRunLoopRef _tapThreadRL;
15	BOOL _shouldInterceptMediaKeyEvents;
16	id _delegate;
17	// The app that is frontmost in this list owns media keys
18	NSMutableArray *_mediaKeyAppList;
19}
20+ (NSArray*)defaultMediaKeyUserBundleIdentifiers;
21
22-(id)initWithDelegate:(id)delegate;
23
24+(BOOL)usesGlobalMediaKeyTap;
25-(void)startWatchingMediaKeys;
26-(void)stopWatchingMediaKeys;
27-(void)handleAndReleaseMediaKeyEvent:(NSEvent *)event;
28@end
29
30@interface NSObject (SPMediaKeyTapDelegate)
31-(void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
32@end
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38extern NSString *kMediaKeyUsingBundleIdentifiersDefaultsKey;
39extern NSString *kIgnoreMediaKeysDefaultsKey;
40
41#ifdef __cplusplus
42}
43#endif