I need to create the equivalent of a menu item shortcut, but without the menu item... or, to assign two different shortcuts to the same menu item.

More precisely: I have a menu item with a shortcut of Command+L.

I need Command+Shift+L to do exactly the same thing, but it doesn't look right having two copies of the menu item just to support a second shortcut.

This needs to work across multiple windows of the application, and there are enough distinct types that it would be annoying to need to create and maintain a separate implementation of a solution for each separate window.

Anyone know how I might be able to pull this off? Neither the NSApplication nor the NSDocument seem to receive the "performKeyEquivalent:" method, so not quite sure where to go with this one.


Note that I am doing this because of interfacing with an external controller which, because of the way I am hoping to rig this to behave in a reasonable way, will sometimes send the keystroke with and sometimes without the shift - this is an implementation detail that I don't expect the user to be aware of (if they happen to hold down shift while hitting Command+L... I don't particularly care - won't really matter :-)


Thank you!



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to