Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

When LSUIElement is set to NO most of shortcuts are handled by application's main menu. But when LSUIElement is set to YES, there is no main menu and then no common shortcuts are forwarded to a first responder.

The naive solution would be overriding performKeyEquivalent: for each view/window class. But I only want to handle common shortcuts, not special one. So, I'm looking for a better solution.

like image 660
Kentzo Avatar asked Mar 05 '11 17:03

Kentzo


1 Answers

I found this http://cocoa.flyingmac.com/2010/07/cut-copy-and-paste-in-lsuielement-applications/. But that doesn't seem like it's what you want and I guess could just be a last resort. That guide just illustrates how to manually implement the keyboard shortcuts yourself.

EDIT: Just implemented this into one of my apps and it works perfectly.

like image 88
edc1591 Avatar answered Oct 11 '22 14:10

edc1591