keypress events + responder chain
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