From 2eb019c5a6863b8bf7812b1fd0daa062d3795bc0 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 4 Nov 2011 18:07:02 -0700 Subject: [PATCH] Turn events back on! --- Atom/Classes/AtomApp.m | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) 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 {