Fixed beeping introduced when we started passing key events through the responder chain.
authorSam Lantinga <slouken@libsdl.org>
Sat, 29 Sep 2012 02:50:42 -0700
changeset 6514 e94c2eaaa1ab
parent 6513 c781fb99ce39
child 6515 f750d9ecae1e
Fixed beeping introduced when we started passing key events through the responder chain.
src/video/cocoa/SDL_cocoawindow.m
--- a/src/video/cocoa/SDL_cocoawindow.m	Sat Sep 29 01:12:40 2012 -0700
+++ b/src/video/cocoa/SDL_cocoawindow.m	Sat Sep 29 02:50:42 2012 -0700
@@ -224,6 +224,29 @@
     }
 }
 
+// We'll respond to key events by doing nothing so we don't beep.
+// We could handle key messages here, but we lose some in the NSApp dispatch,
+// where they get converted to action messages, etc.
+- (void)flagsChanged:(NSEvent *)theEvent
+{
+    //Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);
+}
+- (void)keyDown:(NSEvent *)theEvent
+{
+    //Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);
+}
+- (void)keyUp:(NSEvent *)theEvent
+{
+    //Cocoa_HandleKeyEvent(SDL_GetVideoDevice(), theEvent);
+}
+
+// We'll respond to selectors by doing nothing so we don't beep.
+// The escape key gets converted to a "cancel" selector, etc.
+- (void)doCommandBySelector:(SEL)aSelector
+{
+    //NSLog(@"doCommandBySelector: %@\n", NSStringFromSelector(aSelector));
+}
+
 - (void)mouseDown:(NSEvent *)theEvent
 {
     int button;