{
NSMutableDictionary* mHotKeys; //Keys are NSValue of EventHotKeyRef
BOOL mEventHandlerInstalled;
+ BOOL _enabled;
}
+ (id)sharedCenter;
+- (BOOL)isEnabled;
+- (void)setEnabled:(BOOL)flag;
+
- (BOOL)registerHotKey: (ITHotKey*)hotKey;
- (void)unregisterHotKey: (ITHotKey*)hotKey;
if( self )
{
mHotKeys = [[NSMutableDictionary alloc] init];
+ _enabled = YES;
}
return self;
#pragma mark -
+- (BOOL)isEnabled
+{
+ return _enabled;
+}
+
+- (void)setEnabled:(BOOL)flag
+{
+ _enabled = flag;
+}
+
- (BOOL)registerHotKey: (ITHotKey*)hotKey
{
OSStatus err;
long subType;
EventHotKeyRef carbonHotKey;
+ if (!_enabled) {
+ return;
+ }
+
//We only have to intercept sendEvent to do hot keys on old system versions
if( [self _hasCarbonEventSupport] )
return;
OSStatus err;
EventHotKeyID hotKeyID;
ITHotKey* hotKey;
-
+
+ if (!_enabled) {
+ return -1;
+ }
+
NSAssert( [self _hasCarbonEventSupport], @"" );
NSAssert( GetEventClass( event ) == kEventClassKeyboard, @"Unknown event class" );
objectVersion = 39;
objects = {
014CEA440018CDF011CA2923 = {
- buildRules = (
- );
buildSettings = {
COPY_PHASE_STRIP = NO;
DEBUGGING_SYMBOLS = YES;
name = Development;
};
014CEA450018CDF011CA2923 = {
- buildRules = (
- );
buildSettings = {
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
0867D690FE84028FC02AAC07 = {
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.2;
- SDKROOT = /Developer/SDKs/MacOSX10.2.7.sdk;
+ SDKROOT = /Developer/SDKs/MacOSX10.2.8.sdk;
};
buildStyles = (
014CEA440018CDF011CA2923,
sourceTree = "<group>";
};
0867D69BFE84028FC02AAC07 = {
- fallbackIsa = PBXFileReference;
- isa = PBXFrameworkReference;
+ isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = Foundation.framework;
path = /System/Library/Frameworks/Foundation.framework;
sourceTree = "<absolute>";
};
0867D6A5FE840307C02AAC07 = {
- fallbackIsa = PBXFileReference;
- isa = PBXFrameworkReference;
+ isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = AppKit.framework;
path = /System/Library/Frameworks/AppKit.framework;
sourceTree = "<group>";
};
1058C7B1FEA5585E11CA2CBB = {
- fallbackIsa = PBXFileReference;
- isa = PBXFrameworkReference;
+ isa = PBXFileReference;
lastKnownFileType = wrapper.framework;
name = Cocoa.framework;
path = /System/Library/Frameworks/Cocoa.framework;