Refactor CommandManager to simplify key press checks by removing unnecessary GetKeyIndex calls
This commit is contained in:
@@ -13,7 +13,7 @@ void CommandManager::ShowWhichKey() {
|
|||||||
InitializeDefaults();
|
InitializeDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space))) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Space)) {
|
||||||
ImGui::OpenPopup("WhichKey");
|
ImGui::OpenPopup("WhichKey");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ void CommandManager::ShowWhichKey() {
|
|||||||
ImGuiCond_Always);
|
ImGuiCond_Always);
|
||||||
if (ImGui::BeginPopup("WhichKey")) {
|
if (ImGui::BeginPopup("WhichKey")) {
|
||||||
// ESC to close the popup
|
// ESC to close the popup
|
||||||
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Escape))) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user