Revert f0a8372278
for SDL1.2 only
This commit is contained in:
parent
f0a8372278
commit
eebe3cfb75
1 changed files with 32 additions and 0 deletions
|
@ -16,6 +16,38 @@ static char **gArgv;
|
|||
@interface SDLApplication : NSApplication
|
||||
@end
|
||||
|
||||
#if !SDL_VERSION_ATLEAST(2,0,0)
|
||||
@implementation SDLApplication
|
||||
/* Invoked from the Quit menu item */
|
||||
- (void)terminate:(id)sender
|
||||
{
|
||||
/* Post a SDL_QUIT event */
|
||||
SDL_Event event;
|
||||
event.type = SDL_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
|
||||
- (BOOL)_handleKeyEquivalent:(NSEvent *)theEvent
|
||||
{
|
||||
[[super mainMenu] performKeyEquivalent:theEvent];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) sendEvent:(NSEvent *)event
|
||||
{
|
||||
if(NSKeyDown == [event type] || NSKeyUp == [event type])
|
||||
{
|
||||
if([event modifierFlags] & NSCommandKeyMask)
|
||||
{
|
||||
[super sendEvent: event];
|
||||
}
|
||||
} else {
|
||||
[super sendEvent: event];
|
||||
}
|
||||
}
|
||||
@end
|
||||
#endif
|
||||
|
||||
/* The main class of the application, the application's delegate */
|
||||
@implementation SDLMain
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue