Reputation: 3479
I have a Cocoa app that embeds a WebView. I'd like to intercept a keyboard shortcut so that I may perform an action in the WebView.
I do not want to implement a menu item for this action. In fact, ideally I only want this shortcut to apply when the user is in a textarea box in the WebView.
How do I catch the keyboard shortcut so that I can pass it on to my WebView?
Upvotes: 1
Views: 1152
Reputation: 5861
You can either have something higher up in the responder chain handle it first or use a CGEventTap if that doesn't cut it.
Upvotes: 1