Refactor CommandManager to simplify key press checks by removing unnecessary GetKeyIndex calls

This commit is contained in:
scawful
2024-11-08 00:14:44 -05:00
parent 0ca27cd35c
commit 2ddc04a5ce

View File

@@ -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();
}