From a3a8dd7f0da5059d2a2d4b6cc8b8c6a5d7e76f31 Mon Sep 17 00:00:00 2001 From: Yohanan <23298480+YohananDiamond@users.noreply.github.com> Date: Mon, 3 Jul 2023 22:32:54 -0300 Subject: [PATCH] Exit with ESC (#1195) --- extern/igfd/ImGuiFileDialogConfig.h | 4 ++-- src/gui/newSong.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extern/igfd/ImGuiFileDialogConfig.h b/extern/igfd/ImGuiFileDialogConfig.h index 4a212b60..8f06588a 100644 --- a/extern/igfd/ImGuiFileDialogConfig.h +++ b/extern/igfd/ImGuiFileDialogConfig.h @@ -36,8 +36,8 @@ //#define IGFD_KEY_BACKSPACE GLFW_KEY_BACKSPACE // by ex you can quit the dialog by pressing the key excape -//#define USE_DIALOG_EXIT_WITH_KEY -//#define IGFD_EXIT_KEY GLFW_KEY_ESCAPE +#define USE_DIALOG_EXIT_WITH_KEY +#define IGFD_EXIT_KEY ImGuiKey_Escape // widget // filter combobox width diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index 735f8bfb..fd7eace7 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -140,7 +140,7 @@ void FurnaceGUI::drawNewSong() { ImGui::SameLine(); - if (ImGui::Button("Cancel")) { + if (ImGui::Button("Cancel") || ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); }