From 6cb22ea75b2a304c102962631851ffa9e7ee13b2 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 5 Aug 2022 10:55:53 +0200 Subject: [PATCH] sys: Unlock framerate when keys are pressed --- main/source/window/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/source/window/window.cpp b/main/source/window/window.cpp index 26e05cb14..6110948c5 100644 --- a/main/source/window/window.cpp +++ b/main/source/window/window.cpp @@ -178,7 +178,7 @@ namespace hex { } else { glfwPollEvents(); - bool frameRateUnlocked = ImGui::IsPopupOpen(ImGuiID(0), ImGuiPopupFlags_AnyPopupId) || Task::getRunningTaskCount() > 0 || this->m_mouseButtonDown || this->m_hadEvent; + bool frameRateUnlocked = ImGui::IsPopupOpen(ImGuiID(0), ImGuiPopupFlags_AnyPopupId) || Task::getRunningTaskCount() > 0 || this->m_mouseButtonDown || this->m_hadEvent || !this->m_pressedKeys.empty(); const double timeout = std::max(0.0, (1.0 / 5.0) - (glfwGetTime() - this->m_lastFrameTime)); if ((this->m_lastFrameTime - this->m_frameRateUnlockTime) > 5 && this->m_frameRateTemporarilyUnlocked && !frameRateUnlocked) {