[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 { 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) { switch (key) {
case core::Key::Num_1: case core::Key::Num_1:
toggleProjectExplorer(); toggleProjectExplorer();
@ -89,10 +90,12 @@ void StudioUI::handleKeyEvent(core::Key key, bool down) noexcept {
undo(); undo();
break; break;
default: default:
if (m_activeEditor) {
m_activeEditor->keyStateChanged(key, down);
}
break; break;
} }
} } else if (m_activeEditor && !ctrlDown) {
if (m_activeEditor) {
m_activeEditor->keyStateChanged(key, down); m_activeEditor->keyStateChanged(key, down);
} }
} }