• 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
keypress events + responder chain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

keypress events + responder chain


  • Subject: keypress events + responder chain
  • From: Alex Reynolds <email@hidden>
  • Date: Tue, 17 Oct 2006 04:08:34 -0400

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.

I have a NSTextField in a subclassed NSWindow.

My NSWindow subclass contains a keyDown: method to see if the Escape button is pressed.

I connected the initialFirstResponder of my NSWindow subclass to the nib's File Owner.

When I first start the application, it responds to Escape keypresses.

If I click inside the NSTextField, I then lose the ability to track Escape keypresses.

How do I reconnect my NSWindow to the responder chain, or otherwise continue to be able to track Escape keypresses after clicking inside the NSTextField, or after clicking Tab to get outside the NSTextField?

If I set -resignFirstResponder to NO on my NSWindow subclass, I can keep tracking Escape keypresses, but now I can't click inside the NSTextField to modify its contents.

I also tried connecting the -nextKeyView outlet from the NSTextField to my subclassed NSWindow's NSView. This did not work. I could not Tab outside the NSTextField to regain the ability to track Escape keypresses.

Does anyone know how I could fix this?

Thanks for any advice,

Regards,
Alex
_______________________________________________
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


  • Follow-Ups:
    • Re: keypress events + responder chain
      • From: Dustin Voss <email@hidden>
    • Re: keypress events + responder chain
      • From: j o a r <email@hidden>
    • Re: keypress events + responder chain
      • From: Buddy Kurz <email@hidden>
  • Prev by Date: coredata and loooooooooooooooong waits
  • Next by Date: Re: coredata and loooooooooooooooong waits
  • Previous by thread: Re: coredata and loooooooooooooooong waits
  • Next by thread: Re: keypress events + responder chain
  • Index(es):
    • Date
    • Thread