How can I handle shortcuts when LSUIElement is set to YES?

If LSUIElement set to NO , most shortcuts are handled by the main application menu. But when LSUIElement set to YES , there is no main menu, and no common shortcuts are sent to the first responder.

A naive solution would override performKeyEquivalent: for each view / window class. But I just want to handle general shortcuts, not special ones. So, I am looking for the best solution.

+8
cocoa appkit keyboard-shortcuts
source share
1 answer

I found this http://cocoa.flyingmac.com/2010/07/cut-copy-and-paste-in-lsuielement-applications/ . But this does not look like what you want, and I think it can only be a last resort. This guide simply illustrates how to manually implement keyboard shortcuts yourself.

EDIT: Just implemented this in one of my applications, and it works great.

+7
source share

All Articles