impr: Allow more popups to be closed with Escape

This commit is contained in:
WerWolv
2023-12-13 15:08:27 +01:00
parent 92043a3d23
commit 346f1362c6
10 changed files with 24 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ public:
}
ImGui::SameLine();
ImGui::SetCursorPosX(width / 9 * 5);
if (ImGui::Button("hex.builtin.common.no"_lang, ImVec2(width / 3, 0))) {
if (ImGui::Button("hex.builtin.common.no"_lang, ImVec2(width / 3, 0)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) {
s_yesNoQuestionBoxResult = false;
this->close();
}
@@ -87,7 +87,7 @@ public:
ImGui::EndDisabled();
ImGui::SameLine();
ImGui::SetCursorPosX(width / 9 * 5);
if (ImGui::Button("hex.builtin.common.cancel"_lang, ImVec2(width / 3, 0))) {
if (ImGui::Button("hex.builtin.common.cancel"_lang, ImVec2(width / 3, 0)) || ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) {
s_inputTextBoxResult = "";
this->close();
}