Enabling keyboard shortcuts in nswindow
Enabling keyboard shortcuts in nswindow
- Subject: Enabling keyboard shortcuts in nswindow
- From: Lorenzo Thurman <email@hidden>
- Date: Mon, 16 Nov 2009 23:38:50 -0600
I have an NSStatusItem where I am using an NSWindow as it's About Box.
When displayed, I can close the window via a mouse click, but not with
the cmd w shortcut. I've looked In Apple documents about this, but the
documentation assumes a document based app where this action is tied
to the file->close window menuitem. How do I get this behavior for an
NSStatusItem? Pardon me if this is basic, but I can't find the answer.
My window uses a subclass of NSWindowController and from what I've
found, I should be able to make it the first responder and then
override it's (nsresponder) keyDown method to handle this event, but
no dice; all I get is a beep. So, if someone can point me in the right
direction, I'd appreciate it.
--"My break-dancing days are over, but there's always the funky chicken"
The Full Monty
_______________________________________________
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