Fix beeps by just not posting keydown events.
This commit is contained in:
@@ -31,16 +31,13 @@ static BOOL gFinderLaunch;
|
|||||||
event.type = SDL_QUIT;
|
event.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
}
|
}
|
||||||
@end
|
|
||||||
|
|
||||||
@interface HelperWindow : NSWindow
|
- (void)sendEvent:(NSEvent *)event
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation HelperWindow
|
|
||||||
/* Override NSWindow's keyDown to keep it from beeping. */
|
|
||||||
- (void) keyDown:(NSEvent *)event
|
|
||||||
{
|
{
|
||||||
|
if( [event type] != NSKeyDown )
|
||||||
|
[super sendEvent:event];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/* The main class of the application, the application's delegate */
|
/* 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] = argv[i];
|
||||||
gArgv[i] = NULL;
|
gArgv[i] = NULL;
|
||||||
|
|
||||||
[HelperWindow poseAsClass:[NSWindow class]];
|
|
||||||
[SDLApplication poseAsClass:[NSApplication class]];
|
[SDLApplication poseAsClass:[NSApplication class]];
|
||||||
CustomApplicationMain (argc, argv);
|
CustomApplicationMain (argc, argv);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user