- 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:
Franck Charlet
2009-05-14 13:49:36 +00:00
parent 315a17ae5b
commit 2feab9d52c
9 changed files with 85 additions and 21 deletions

View File

@@ -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);