From d32143b3194bf91991dc931200535d351ce2764c Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 29 Sep 2024 15:29:40 +1000 Subject: [PATCH] ImGuiOverlays: Make escape close save state selector --- src/core/imgui_overlays.cpp | 8 ++++++++ src/util/input_manager.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/imgui_overlays.cpp b/src/core/imgui_overlays.cpp index f1ebd0114..8327969dc 100644 --- a/src/core/imgui_overlays.cpp +++ b/src/core/imgui_overlays.cpp @@ -1107,7 +1107,15 @@ void SaveStateSelectorUI::Draw() // auto-close s_open_time += io.DeltaTime; if (s_open_time >= s_close_time) + { Close(); + } + else if (ImGui::IsKeyPressed(ImGuiKey_Escape)) + { + // Need to cancel the hotkey bindings, otherwise the pause menu will open. + InputManager::ClearBindStateFromSource(InputManager::MakeHostKeyboardKey(0)); + Close(); + } } s32 SaveStateSelectorUI::GetCurrentSlot() diff --git a/src/util/input_manager.cpp b/src/util/input_manager.cpp index 4c17cee8c..c98c2815c 100644 --- a/src/util/input_manager.cpp +++ b/src/util/input_manager.cpp @@ -1142,7 +1142,7 @@ void InputManager::ClearBindStateFromSource(InputBindingKey key) if (current_mask == binding->full_mask) { - std::get(binding->handler)(0); + std::get(binding->handler)(-1); matched = true; break; }