electron/brightray/browser/default_web_contents_delegate_mac.mm
Adam Roben be6d990a97 Make keyboard shortcuts work on Mac
When the renderer doesn't handle a key event, we pass it off to the main menu
to see if it can handle it.

Part of #2.
2013-03-14 13:50:15 -04:00

15 lines
No EOL
390 B
Text

#import "browser/default_web_contents_delegate.h"
#import "content/public/browser/native_web_keyboard_event.h"
#import <AppKit/AppKit.h>
namespace brightray {
void DefaultWebContentsDelegate::HandleKeyboardEvent(content::WebContents*, const content::NativeWebKeyboardEvent& event) {
if (event.skip_in_browser)
return;
[[NSApp mainMenu] performKeyEquivalent:event.os_event];
}
}