From 15f8a9b66f20312e62733e3079eb082935fb5e12 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 17 Jan 2022 21:34:57 -0500 Subject: [PATCH] GUI: prevent stuck note if ImGui wants capture kb --- src/gui/gui.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index a8f56fb76..c426fa070 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3057,6 +3057,13 @@ bool FurnaceGUI::loop() { case SDL_KEYUP: if (!ImGui::GetIO().WantCaptureKeyboard) { keyUp(ev); + } else { + if (noteOffOnRelease) { + if (ev.key.keysym.scancode==noteOffOnReleaseKey) { + noteOffOnRelease=false; + e->noteOff(noteOffOnReleaseChan); + } + } } break; case SDL_QUIT: