From 7c8a19978d52384d277e67b77e61f24a00b9ea23 Mon Sep 17 00:00:00 2001 From: Panos Karabelas Date: Sun, 21 Jan 2018 16:02:09 +0000 Subject: [PATCH] Simplified return of ImGui::IsKeyReleased() --- imgui.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index c34190b4..c41c8b52 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3507,9 +3507,7 @@ bool ImGui::IsKeyReleased(int user_key_index) ImGuiContext& g = *GImGui; if (user_key_index < 0) return false; IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown)); - if (g.IO.KeysDownDurationPrev[user_key_index] >= 0.0f && !g.IO.KeysDown[user_key_index]) - return true; - return false; + return g.IO.KeysDownDurationPrev[user_key_index] >= 0.0f && !g.IO.KeysDown[user_key_index]; } bool ImGui::IsMouseDown(int button)