How to read general user input in cocoa?
I am writing an app that automatically has an image load full screen immediately after the app is launched. When this happens, it seems that the only way for the user to get out of this full screen mode is to CMD-Q and quit the app. How can I set my own custom key stroke combination so the user can exi开发者_如何学Ct full screen mode and edit the app's settings? (ie, how can i set it so that something like "CMD-Option-5" will exit the full screen mode and allow editing without closing the entire application?
Have you read the documentation?
I'd suggest capturing the escape key over a keyboard combination. See the Handling Key Events section of the Cocoa Event-Handling Guide.
Aside from that, you can just create a menu item in your main menu and assign the desired keyboard shortcut to it. The menu item's action will call some method that escapes full screen mode.
精彩评论