views:

81

answers:

1

Hi,

I'm trying to make a window open when the user pressed Cmd + L but how can I make my controller object listen to that particular key combination?

+3  A: 

Create a menu item, set its shortcut to Cmd-L, and connect it to an action on that controller (or on another controller, which forwards to your desired controller).

Or ... read the Handling Key Events section of the Cocoa Event-Handling Guide and implement a custom view that, when it is the first responder, interprets this key event and notifies your controller.

Or ... insert your controller into the responder chain.

... but the easiest method is the first I mentioned.

Joshua Nozzi