diff --git a/UI/ImDebugger/ImMemView.cpp b/UI/ImDebugger/ImMemView.cpp index 2d2f2e5f4d..7acea19d12 100644 --- a/UI/ImDebugger/ImMemView.cpp +++ b/UI/ImDebugger/ImMemView.cpp @@ -1218,8 +1218,10 @@ void ImMemWindow::Draw(MIPSDebugInterface *mipsDebug, ImConfig &cfg, ImControl & StatusBar(memView_.StatusMessage()); + // These are single letters, so only take them when this window has focus, or they'd be stolen from the game. + const bool focused = ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); ImGui::End(); - if (!ImGui::GetIO().WantTextInput) { + if (focused && !ImGui::GetIO().WantTextInput) { ProcessKeyboardShortcuts(); } } diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index d42cc72aa7..628646b54c 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -446,6 +446,8 @@ void runImDebugger(Draw::DrawContext *draw) { SetOverrideScreenFrame(nullptr); if (imDebugger_) { imDebugger_->OnHidden(); + // Key events don't reach imgui while it's hidden, so it would miss the release of a key held when it closed. + ImGui::GetIO().ClearInputKeys(); } }