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: Jens Alfke <email@hidden>
- Date: Thu, 17 Jul 2008 11:55:23 -0700
On 17 Jul '08, at 10:45 AM, Andy Lee wrote:
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.
Well, if I'm going to subclass, I'll just subclass NSWindow and handle
the event there. I wasn't posting because I didn't know how to do it;
rather, because it seems awkward (and atypical of Cocoa) that you have
to subclass something to get the event; especially since my window
delegate is already in the responder chain. I thought maybe I was
overlooking a simpler way to do it by delegation.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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