diff --git a/include/util/common.hpp b/include/util/common.hpp index dbc3e462..52ed73ed 100644 --- a/include/util/common.hpp +++ b/include/util/common.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff --git a/src/app/RackScene.cpp b/src/app/RackScene.cpp index 5ae0fbc5..bf1ea0ea 100644 --- a/src/app/RackScene.cpp +++ b/src/app/RackScene.cpp @@ -86,43 +86,45 @@ void RackScene::draw(NVGcontext *vg) { } void RackScene::onHoverKey(EventHoverKey &e) { - switch (e.key) { - case GLFW_KEY_N: - if (guiIsModPressed() && !guiIsShiftPressed()) { - gRackWidget->reset(); - e.consumed = true; - return; - } - break; - case GLFW_KEY_Q: - if (guiIsModPressed() && !guiIsShiftPressed()) { - guiClose(); - e.consumed = true; - return; - } - break; - case GLFW_KEY_O: - if (guiIsModPressed() && !guiIsShiftPressed()) { - gRackWidget->openDialog(); - e.consumed = true; - return; - } - break; - case GLFW_KEY_S: - if (guiIsModPressed() && !guiIsShiftPressed()) { - gRackWidget->saveDialog(); - e.consumed = true; - return; - } - if (guiIsModPressed() && guiIsShiftPressed()) { - gRackWidget->saveAsDialog(); - e.consumed = true; - return; - } - break; - } - Widget::onHoverKey(e); + + if (!e.consumed) { + switch (e.key) { + case GLFW_KEY_N: { + if (guiIsModPressed() && !guiIsShiftPressed()) { + gRackWidget->reset(); + e.consumed = true; + return; + } + } break; + case GLFW_KEY_Q: { + if (guiIsModPressed() && !guiIsShiftPressed()) { + guiClose(); + e.consumed = true; + return; + } + } break; + case GLFW_KEY_O: { + if (guiIsModPressed() && !guiIsShiftPressed()) { + gRackWidget->openDialog(); + e.consumed = true; + return; + } + } break; + case GLFW_KEY_S: { + if (guiIsModPressed() && !guiIsShiftPressed()) { + gRackWidget->saveDialog(); + e.consumed = true; + return; + } + if (guiIsModPressed() && guiIsShiftPressed()) { + gRackWidget->saveAsDialog(); + e.consumed = true; + return; + } + } break; + } + } } void RackScene::onPathDrop(EventPathDrop &e) {