summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Frame.cpp
diff options
context:
space:
mode:
authorMat M <mathew1800@gmail.com>2017-04-08 17:28:13 -0400
committerGitHub <noreply@github.com>2017-04-08 17:28:13 -0400
commit3013252d4f847f531df653552ac375973f666992 (patch)
treee6fc70305eaf0069945889c8aacf3fa7beb8079c /Source/Core/DolphinWX/Frame.cpp
parent59d93f3a0da961dbbf8df3fb810ad0339d187c00 (diff)
parenta793b4d06f90d393d37aa99249bb0189f97d8a4c (diff)
Merge pull request #5222 from MerryMage/keyb
Frame: Fix macOS keyboard while emulation is running
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
-rw-r--r--Source/Core/DolphinWX/Frame.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index 82a48a7bef..ddedd06525 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -1040,12 +1040,20 @@ static int GetMenuIDFromHotkey(unsigned int key)
void CFrame::OnKeyDown(wxKeyEvent& event)
{
-// On OS X, we claim all keyboard events while
-// emulation is running to avoid wxWidgets sounding
-// the system beep for unhandled key events when
-// receiving pad/Wiimote keypresses which take an
-// entirely different path through the HID subsystem.
-#ifndef __APPLE__
+#ifdef __APPLE__
+ // On OS X, we claim all keyboard events while
+ // emulation is running to avoid wxWidgets sounding
+ // the system beep for unhandled key events when
+ // receiving pad/Wiimote keypresses which take an
+ // entirely different path through the HID subsystem.
+ if (!m_bRendererHasFocus)
+ {
+ // We do however want to pass events on when the
+ // render window is out of focus: this allows use
+ // of the keyboard in the rest of the UI.
+ event.Skip();
+ }
+#else
// On other platforms, we leave the key event alone
// so it can be passed on to the windowing system.
event.Skip();