Re: cancelOperation: does not work for trapping the escape key
Re: cancelOperation: does not work for trapping the escape key
- Subject: Re: cancelOperation: does not work for trapping the escape key
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 18 Dec 2007 18:54:26 +0100
Le 18 déc. 07 à 18:41, Kenny Leung a écrit :
Sorry, I was not clear. My class is a window controller, which means
that it is in the responder chain after the window itself. It is
successfully getting keyDown: events for other keys, but nothing
gets called for the escape key. Just in case, I overrode
acceptsFirstResponder to return YES, but no dice.
You can see a small example at http://www.hexdreams.com/temp/CancelOperationTest.zip
that illustrates my point.
-Kenny
I think the - (BOOL)performKeyEquivalent:(NSEvent *)theEvent method
catch your escape event before it reach the keyDown: method.
If performKeyEquivalent return YES, the keyDown: method will no be call.
You can find a very good graph fo the event flow here:
http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/chapter_2_section_3.html#/
/apple_ref/doc/uid/10000060i-CH3-SW10
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden