Mercurial > dwindows
comparison mac/dw.m @ 1133:25bea6526ca1
Similar Mac fix to what I just commited on Windows...
Event handler returns -1 when event was unhandled, so send the
events only if the handler did not return TRUE.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 06 Sep 2011 19:53:39 +0000 |
parents | c3138ffd0de0 |
children | 41a93f9896e3 |
comparison
equal
deleted
inserted
replaced
1132:6d618dcff792 | 1133:25bea6526ca1 |
---|---|
701 @end | 701 @end |
702 | 702 |
703 @implementation DWWindow | 703 @implementation DWWindow |
704 -(void)sendEvent:(NSEvent *)theEvent | 704 -(void)sendEvent:(NSEvent *)theEvent |
705 { | 705 { |
706 int rcode = 0; | 706 int rcode = -1; |
707 if([theEvent type] == NSKeyDown) | 707 if([theEvent type] == NSKeyDown) |
708 { | 708 { |
709 rcode = _event_handler(self, theEvent, 2); | 709 rcode = _event_handler(self, theEvent, 2); |
710 } | 710 } |
711 if ( rcode == 0 ) | 711 if ( rcode != TRUE ) |
712 [super sendEvent:theEvent]; | 712 [super sendEvent:theEvent]; |
713 } | 713 } |
714 -(void)keyDown:(NSEvent *)theEvent { } | 714 -(void)keyDown:(NSEvent *)theEvent { } |
715 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } | 715 -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } |
716 -(int)redraw { return redraw; } | 716 -(int)redraw { return redraw; } |