From 2ddc04a5ce834637193ac53d793fd8898a3a8892 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 8 Nov 2024 00:14:44 -0500 Subject: [PATCH] Refactor CommandManager to simplify key press checks by removing unnecessary GetKeyIndex calls --- src/app/editor/system/command_manager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/editor/system/command_manager.cc b/src/app/editor/system/command_manager.cc index 7cec2d57..e14e48a3 100644 --- a/src/app/editor/system/command_manager.cc +++ b/src/app/editor/system/command_manager.cc @@ -13,7 +13,7 @@ void CommandManager::ShowWhichKey() { InitializeDefaults(); } - if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) { + if (ImGui::IsKeyPressed(ImGuiKey_Space)) { ImGui::OpenPopup("WhichKey"); } @@ -23,7 +23,7 @@ void CommandManager::ShowWhichKey() { ImGuiCond_Always); if (ImGui::BeginPopup("WhichKey")) { // ESC to close the popup - if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) { + if (ImGui::IsKeyPressed(ImGuiKey_Escape)) { ImGui::CloseCurrentPopup(); }