Keyboard? Key events?

I try to open a window when the user presses Cmd + L, but how can I get the controller object to listen to this particular key combination?

+1
source share
1 answer

Create a menu item, set its shortcut to Cmd-L and connect it to the action on this controller (or on another controller that will go to your desired controller).

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

... .

... - , .

+3

Source: https://habr.com/ru/post/1722113/


All Articles