Re: keypress events + responder chain
Re: keypress events + responder chain
- Subject: Re: keypress events + responder chain
- From: Alex Reynolds <email@hidden>
- Date: Wed, 18 Oct 2006 10:49:10 -0400
Thanks everyone.
I solved this by overriding sendEvent in my NSWindow subclass:
- (void) sendEvent: (NSEvent *) theEvent
{
if (([theEvent type]==NSKeyDown) && ([theEvent keyCode] == 53))
{
[[NSNotificationCenter defaultCenter]
postNotificationName:@"notifyEscapeKeyPressedFromControllerWindow"
object:self];
}
[super sendEvent: theEvent];
}
I haven't tried cancelOperation: but that seems like one possible
explanation why keyDown: fails.
-Alex
On Oct 17, 2006, at 11:36 PM, Dustin Voss wrote:
On 17 Oct 2006, at 1:08 AM, Alex Reynolds wrote:
I'd like to be able to track Escape keypresses but I can't seem to
get any control over the responder chain. This is very frustrating.
http://cocoadev.com/?NSResponder
Implement _cancelKey: or cancelOperation: in your NSWindow sub-
class or delegate, that should work.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden