- Issue #160 should be fixed now.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@804 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
16
SDLMain.m
16
SDLMain.m
@@ -76,6 +76,20 @@ static NSString *getApplicationName(void)
|
||||
event.type = SDL_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
/* override NSApplication:sendEvent, to keep Cocoa from beeping on
|
||||
non-command keystrokes */
|
||||
- (void)sendEvent:(NSEvent *)anEvent {
|
||||
if (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) {
|
||||
if ([anEvent modifierFlags] & NSCommandKeyMask)
|
||||
{
|
||||
SDL_SetModState(SDL_GetModState() | KMOD_META);
|
||||
[super sendEvent: anEvent];
|
||||
}
|
||||
} else
|
||||
{
|
||||
[super sendEvent: anEvent];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
/* The main class of the application, the application's delegate */
|
||||
@@ -297,6 +311,8 @@ static void CustomApplicationMain (int argc, char **argv)
|
||||
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
|
||||
#endif
|
||||
|
||||
setenv("SDL_ENABLEAPPEVENTS", "1", 1);
|
||||
|
||||
/* Hand off to main application code */
|
||||
gCalledAppMainline = TRUE;
|
||||
status = SDL_main (gArgc, gArgv);
|
||||
|
||||
Reference in New Issue
Block a user