diff --git a/ImFileDialog.cpp b/ImFileDialog.cpp index 53832d9..81e04b1 100644 --- a/ImFileDialog.cpp +++ b/ImFileDialog.cpp @@ -14,6 +14,7 @@ #include "stb_image.h" #ifdef _WIN32 +#define NOMINMAX #include #include #include @@ -1406,10 +1407,9 @@ namespace ifd { m_finalize(); } - int escapeKey = ImGui::GetIO().KeyMap[ImGuiKey_Escape]; - if (ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) && - escapeKey >= 0 && ImGui::IsKeyPressed(escapeKey)) - m_isOpen = false; + if (ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) && + ImGuiKey_Escape >= 0 && ImGui::IsKeyPressed(ImGuiKey_Escape)) + m_isOpen = false; } }