From eaab79703fadb1ab3028836f02e618d6ce38c659 Mon Sep 17 00:00:00 2001 From: Daniel Tian Date: Mon, 1 May 2023 03:17:37 -1000 Subject: [PATCH] Allow escape key to close pause menu --- driveruilayer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driveruilayer.cpp b/driveruilayer.cpp index c342ef13..27136181 100644 --- a/driveruilayer.cpp +++ b/driveruilayer.cpp @@ -228,7 +228,9 @@ driver_ui::render_() { ImGui::SetNextWindowSize(ImVec2(-1, -1)); if( ImGui::BeginPopupModal( popupheader, nullptr, 0 ) ) { - if( ImGui::Button( STR_C("Resume"), ImVec2( 150, 0 ) ) ) { + if( ( ImGui::Button( STR_C("Resume"), ImVec2( 150, 0 ) ) ) + || ( ImGui::IsKeyReleased( ImGui::GetKeyIndex( ImGuiKey_Escape ) ) ) ) + { m_relay.post(user_command::pausetoggle, 0.0, 0.0, GLFW_PRESS, 0); } if( ImGui::Button( STR_C("Quit"), ImVec2( 150, 0 ) ) ) {