Re: Handling key equivalents in a controller class?
Re: Handling key equivalents in a controller class?
- Subject: Re: Handling key equivalents in a controller class?
- From: Andy Lee <email@hidden>
- Date: Thu, 17 Jul 2008 13:45:17 -0400
On Jul 16, 2008, at 2:43 PM, Kyle Sluder wrote:
Except what happens if a field editor is key? Then the editor
swallows all keys, including Esc. Or if it doesn't do this by
default, Esc is one of the keys that it can swallow because NSTextView
uses it as the "autocomplete" hotkey.
Didn't this question come up a while ago, and the solution was to
override the event dispatching mechanism before it even reached the
responder chain?
I don't remember the earlier question, but offhand (emphasis on
"offhand") that's what I'd do. I'd add a (BOOL)handleMyKeyDown:
method in a category of NSObject, and override keyDown: in
NSApplication to traverse windows, delegates (perhaps including
control delegates), and descendant views until something returns YES.
If nothing returns YES, of course, call [super keyDown:].
--Andy
_______________________________________________
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