From ab1dc836302d71aa1c7764838b31d7d05d016af9 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 29 May 2022 01:24:48 -0500 Subject: [PATCH] [nostalgia/studio] Make studio only pass key input to Editors if it does not consume it itself --- src/nostalgia/studio/studioapp.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/nostalgia/studio/studioapp.cpp b/src/nostalgia/studio/studioapp.cpp index 34e86d03..d516c8ba 100644 --- a/src/nostalgia/studio/studioapp.cpp +++ b/src/nostalgia/studio/studioapp.cpp @@ -59,7 +59,8 @@ void StudioUI::update() noexcept { } void StudioUI::handleKeyEvent(core::Key key, bool down) noexcept { - if (down && core::buttonDown(m_ctx, core::Key::Mod_Ctrl)) { + const auto ctrlDown = core::buttonDown(m_ctx, core::Key::Mod_Ctrl); + if (down && ctrlDown) { switch (key) { case core::Key::Num_1: toggleProjectExplorer(); @@ -89,10 +90,12 @@ void StudioUI::handleKeyEvent(core::Key key, bool down) noexcept { undo(); break; default: + if (m_activeEditor) { + m_activeEditor->keyStateChanged(key, down); + } break; } - } - if (m_activeEditor) { + } else if (m_activeEditor && !ctrlDown) { m_activeEditor->keyStateChanged(key, down); } }