Re: capturing special keys when focused in an NSTextField
Re: capturing special keys when focused in an NSTextField
- Subject: Re: capturing special keys when focused in an NSTextField
- From: Jens Alfke <email@hidden>
- Date: Sat, 10 Oct 2009 15:06:27 -0700
On Oct 10, 2009, at 1:13 PM, aaron smith wrote:
Quick question - I have a window that I run as a sheet, which contains
an NSTextField to enter a message. I have the window setup to close
the sheet when the Escape key is pressed, however, when the text field
is focused I can't figure out how to respond to these types of special
keys.
IIRC, this event gets handled by the button's -performKeyEquivalent:
method, before normal key processing. You could override that method
in another view to handle the Esc key, but it would probably need to
be an ancestor view of the button. It might be easier just to clear
the button's key equivalent property when the text view gets focus and
restore it afterwards.
—Jens_______________________________________________
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