• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: keypress events + responder chain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >keypress events + responder chain (From: Alex Reynolds <email@hidden>)
 >Re: keypress events + responder chain (From: Dustin Voss <email@hidden>)

  • Prev by Date: Re: Higher Order Messaging
  • Next by Date: Re: How to get hyperlink in a html file?
  • Previous by thread: Re: keypress events + responder chain
  • Next by thread: preserving newline and whitespaces while using NSXmlDocumentTidyXML
  • Index(es):
    • Date
    • Thread