mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
fixed beeping when a non-shortcut was pressed on Mac
This commit is contained in:
@@ -76,6 +76,16 @@ static NSString *getApplicationName(void)
|
||||
event.type = SDL_QUIT;
|
||||
SDL_PushEvent(&event);
|
||||
}
|
||||
|
||||
/* Hack to make Cocoa ignore keystrokes that aren't shortcuts, otherwise it beeps on every key press */
|
||||
- (void)sendEvent:(NSEvent *)theEvent {
|
||||
if (NSKeyDown == [theEvent type] || NSKeyUp == [theEvent type]) {
|
||||
if ([theEvent modifierFlags] & NSCommandKeyMask)
|
||||
[super sendEvent: theEvent];
|
||||
} else {
|
||||
[super sendEvent: theEvent];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
/* The main class of the application, the application's delegate */
|
||||
|
||||
Reference in New Issue
Block a user