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" );