From: Cheng Zhao Date: Fri, 25 Jul 2014 03:03:25 +0000 (+0800) Subject: mac: Make cmd+~ work for devtools window, fixes #508. X-Git-Tag: v0.14.2~8 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f7a9b56e93e2bc1579aa0e5bd80b65643049b248;p=electron.git mac: Make cmd+~ work for devtools window, fixes #508. --- diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 330fb086..22ca45fa 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -538,7 +538,11 @@ void NativeWindowMac::HandleKeyboardEvent( // The event comes from detached devtools view, and it has already been // handled by the devtools itself, we now send it to application menu to // make menu acclerators work. - [[NSApp mainMenu] performKeyEquivalent:event.os_event]; + BOOL handled = [[NSApp mainMenu] performKeyEquivalent:event.os_event]; + // Handle the cmd+~ shortcut. + if (!handled && (event.os_event.modifierFlags & NSCommandKeyMask) && + (event.os_event.keyCode == 50 /* ~ key */)) + Focus(true); } }