Permalink
Browse files

fixed keypresses in mac launcher

git-svn-id: https://sauerbraten.svn.sourceforge.net/svnroot/sauerbraten/src@3312 ac1f7847-fce6-4368-a212-70e9bdee79d4
  • Loading branch information...
1 parent 5332ec4 commit a6b5091c4797f3c5c5f7f57272fe42e614a56bd9 rbrtpntn committed Nov 16, 2010
Showing with 8 additions and 1 deletion.
  1. +2 −0 xcode/Launcher.h
  2. +4 −0 xcode/Launcher.m
  3. +2 −1 xcode/main.m
View
@@ -41,4 +41,6 @@
- (BOOL)serverRunning;
+- (BOOL)gameRunning;
+
@end
View
@@ -567,6 +567,10 @@ - (void)initMaps
[NSThread detachNewThreadSelector: @selector(scanMaps:) toTarget:self withObject:nil];
}
+- (BOOL)gameRunning {
+ return gamerunning;
+}
+
- (void)awakeFromNib
{
[self initPaths];
View
@@ -1,5 +1,6 @@
#import <Cocoa/Cocoa.h>
#import "SDL.h"
+#import "Launcher.h"
@interface SDLApplication : NSApplication
@end
@@ -19,7 +20,7 @@ - (void)terminate:(id)sender
// Prevent beeps from unhandled keys as a consequence of having enabled SDL_ENABLEAPPEVENTS
- (void)sendEvent:(NSEvent *)anEvent
{
- if( NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type] ) {
+ if([(Launcher*)[self delegate] gameRunning] && (NSKeyDown == [anEvent type] || NSKeyUp == [anEvent type]) ) {
if( [anEvent modifierFlags] & NSCommandKeyMask )
[super sendEvent: anEvent];
} else

0 comments on commit a6b5091

Please sign in to comment.