Re: NSDocument-oriented app and -keydown
Re: NSDocument-oriented app and -keydown
- Subject: Re: NSDocument-oriented app and -keydown
- From: Jerry Krinock <email@hidden>
- Date: Thu, 29 Sep 2011 08:30:58 -0700
On 2011 Sep 29, at 07:42, Nick wrote:
> but this does not let (as i understand) attach the event to the particular window-document, it
> is application wide. How can I receive such an event in an NSDocument's subclass?
I'm not sure what you mean by "attach the event", Nick, but the Mac has only one keyboard and therefore any determination of what modifier keys are down is going to be application-wide. You typically "receive" a keyDown (or other) event by overriding, say, -keyDown in any NSResponder subclass (view or window), and then use the Cocoa code given in the post by VassilisGr in that stackoverflow article to find what modifier keys are down.
_______________________________________________
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