diff --git a/Atom/Classes/AtomApp.m b/Atom/Classes/AtomApp.m index 523de45d5..344fa6be8 100644 --- a/Atom/Classes/AtomApp.m +++ b/Atom/Classes/AtomApp.m @@ -63,23 +63,23 @@ } // Overridden -//- (void)sendEvent:(NSEvent *)event { -// if ([event type] == NSKeyDown) { -// BOOL handeled = NO; -// AtomController *controller = [[self keyWindow] windowController]; -// -// // The keyWindow could be a Cocoa Dialog or something, ignore that. -// if ([controller isKindOfClass:[AtomController class]]) { -// JSValueRef value = [controller.jscocoa callJSFunctionNamed:@"handleKeyEvent" withArguments:event, nil]; -// handeled = [controller.jscocoa toBool:value]; -// } -// -// if (!handeled) [super sendEvent:event]; -// } -// else { -// [super sendEvent:event]; -// } -//} +- (void)sendEvent:(NSEvent *)event { + if ([event type] == NSKeyDown) { + BOOL handeled = NO; + AtomController *controller = [[self keyWindow] windowController]; + + // The keyWindow could be a Cocoa Dialog or something, ignore that. + if ([controller isKindOfClass:[AtomController class]]) { + JSValueRef value = [controller.jscocoa callJSFunctionNamed:@"handleKeyEvent" withArguments:event, nil]; + handeled = [controller.jscocoa toBool:value]; + } + + if (!handeled) [super sendEvent:event]; + } + else { + [super sendEvent:event]; + } +} // AppDelegate - (void)applicationWillFinishLaunching:(NSNotification *)aNotification {