Skip to content

Commit

Permalink
Revert f0a8372 for SDL1.2 only
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Sep 24, 2015
1 parent f0a8372 commit eebe3cf
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions projectfiles/Xcode/Mac Sources/SDLMain.m
Expand Up @@ -16,6 +16,38 @@
@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

Expand Down

0 comments on commit eebe3cf

Please sign in to comment.