changeset 898:bf2ca780f62d

One more try at window key handling... since I can't seem to trap keyDown events in most places that get focus... Trap it in the sendEvent method.. this will get all keystrokes destined for this window.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 18 Apr 2011 08:56:33 +0000
parents 2b07bf8ed95b
children 3fbba8b1f440
files mac/dw.m
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Mon Apr 18 06:12:59 2011 +0000
+++ b/mac/dw.m	Mon Apr 18 08:56:33 2011 +0000
@@ -576,11 +576,13 @@
 @end
 
 @interface DWWindow : NSWindow
+-(void)sendEvent:(NSEvent *)theEvent;
 -(void)keyDown:(NSEvent *)theEvent;
 @end
 
 @implementation DWWindow
--(void)keyDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 2); }
+-(void)sendEvent:(NSEvent *)theEvent { if([theEvent type] == NSKeyDown) { _event_handler(self, theEvent, 2); } [super sendEvent:theEvent]; }
+-(void)keyDown:(NSEvent *)theEvent { }
 @end
 
 /* Subclass for a top-level window */