[nostalgia/studio] Make studio only pass key input to Editors if it does not consume it itself

This commit is contained in:
Gary Talent 2022-05-29 01:24:48 -05:00
parent 313e60c3d8
commit ab1dc83630

View File

@ -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);
}
}