diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 3b3e5003a2..f57feb5cd0 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -1023,10 +1023,18 @@ bool EmuScreen::UnsyncKey(const KeyInput &key) { // Enable gamepad controls while running imgui (but ignore mouse/keyboard). switch (key.deviceId) { case DEVICE_ID_KEYBOARD: + if (!ImGui::GetIO().WantCaptureKeyboard) { + controlMapper_.Key(key, &pauseTrigger_); + } + break; case DEVICE_ID_MOUSE: + if (!ImGui::GetIO().WantCaptureMouse) { + controlMapper_.Key(key, &pauseTrigger_); + } break; default: controlMapper_.Key(key, &pauseTrigger_); + break; } } @@ -1035,6 +1043,16 @@ bool EmuScreen::UnsyncKey(const KeyInput &key) { return controlMapper_.Key(key, &pauseTrigger_); } +void EmuScreen::UnsyncAxis(const AxisInput *axes, size_t count) { + System_Notify(SystemNotification::ACTIVITY); + + if (UI::IsFocusMovementEnabled()) { + return UIScreen::UnsyncAxis(axes, count); + } + + return controlMapper_.Axis(axes, count); +} + bool EmuScreen::key(const KeyInput &key) { bool retval = UIScreen::key(key); @@ -1062,16 +1080,6 @@ void EmuScreen::touch(const TouchInput &touch) { } } -void EmuScreen::UnsyncAxis(const AxisInput *axes, size_t count) { - System_Notify(SystemNotification::ACTIVITY); - - if (UI::IsFocusMovementEnabled()) { - return UIScreen::UnsyncAxis(axes, count); - } - - return controlMapper_.Axis(axes, count); -} - class GameInfoBGView : public UI::InertView { public: GameInfoBGView(const Path &gamePath, UI::LayoutParams *layoutParams) : InertView(layoutParams), gamePath_(gamePath) {}