ImDebugger: Send inputs to the game when no windows are focused (click the background)

This commit is contained in:
Henrik Rydgård
2025-01-21 11:52:46 +01:00
parent aa4311cba5
commit 9daa4eae5e
+18 -10
View File
@@ -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) {}