tags:

views:

17

answers:

1

Specifically, I want my "New" menu item to respond to both Cmd+N and Cmd+T since it will open a new document in a tab.* How can I do this either in Interface Builder or programmatically?

* I can explain the reasoning further if needed, but I'm hoping to avoid a discussion of the merits and rather focus on how to do it, not why to do it.

+1  A: 

Make a second one (easiest way being to duplicate it) and set it as hidden. It won't show up when the user pulls open the menu, but as long as it's enabled, its key equivalents should still be in effect.

Peter Hosey
It doesn't seem to be responding to the key equivalent when hidden. I'll keep looking into it though, since there may be something preventing it from being enabled in my code.
Lytol
Well, I'm just explicitly returning YES in `validateMenuItem:` for its selector, and it works fine. It seems like I should be able to ensure that it is enabled in a better way. Any ideas?
Lytol
You should watch session 145 from this year's WWDC: http://developer.apple.com/videos/wwdc/2010/ If you have an ADC account, you should be able to watch it even if you didn't go to the conference.
Peter Hosey