From fd2814642892093ecae1083e9c389568c4daba03 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Fri, 28 Oct 2005 05:40:37 +0000 Subject: [PATCH] Fix beeps by just not posting keydown events. --- stepmania/PBProject/SDLMain.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/stepmania/PBProject/SDLMain.m b/stepmania/PBProject/SDLMain.m index d5ffc53302..59dd523d75 100755 --- a/stepmania/PBProject/SDLMain.m +++ b/stepmania/PBProject/SDLMain.m @@ -31,16 +31,13 @@ static BOOL gFinderLaunch; event.type = SDL_QUIT; SDL_PushEvent(&event); } -@end -@interface HelperWindow : NSWindow -@end - -@implementation HelperWindow -/* Override NSWindow's keyDown to keep it from beeping. */ -- (void) keyDown:(NSEvent *)event +- (void)sendEvent:(NSEvent *)event { + if( [event type] != NSKeyDown ) + [super sendEvent:event]; } + @end /* The main class of the application, the application's delegate */ @@ -244,7 +241,6 @@ int main (int argc, char **argv) gArgv[i] = argv[i]; gArgv[i] = NULL; - [HelperWindow poseAsClass:[NSWindow class]]; [SDLApplication poseAsClass:[NSApplication class]]; CustomApplicationMain (argc, argv); return 0;