mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
ImDebugger: Fix the memory window stealing keys, and keys stuck after closing
The memory window's single-letter shortcuts (F, B, H, U...) were taken even when it wasn't focused, opening the search form and focusing its text field while the game had the keyboard. Only take them when the window is focused, like the disassembly window does. Key events don't reach imgui while the debugger is hidden, so a key held while closing it stayed down. Clear imgui's key state while it's hidden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f6b43ce8e
commit
d946f65270
2 files changed
+5
-1
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user