Browse Source

Fixed onHoverKey traversal

tags/v0.4.0
Andrew Belt 7 years ago
parent
commit
0d24d6926d
2 changed files with 12 additions and 8 deletions
  1. +11
    -4
      src/app/ModuleWidget.cpp
  2. +1
    -4
      src/app/RackScene.cpp

+ 11
- 4
src/app/ModuleWidget.cpp View File

@@ -168,19 +168,26 @@ Widget *ModuleWidget::onMouseMove(Vec pos, Vec mouseRel) {
Widget *ModuleWidget::onHoverKey(Vec pos, int key) {
switch (key) {
case GLFW_KEY_I:
if (guiIsModPressed() && !guiIsShiftPressed())
if (guiIsModPressed() && !guiIsShiftPressed()) {
initialize();
return this;
}
break;
case GLFW_KEY_R:
if (guiIsModPressed() && !guiIsShiftPressed())
if (guiIsModPressed() && !guiIsShiftPressed()) {
randomize();
return this;
}
break;
case GLFW_KEY_D:
if (guiIsModPressed() && !guiIsShiftPressed())
if (guiIsModPressed() && !guiIsShiftPressed()) {
gRackWidget->cloneModule(this);
return this;
}
break;
}
return this;

return Widget::onHoverKey(pos, key);
}

void ModuleWidget::onDragStart() {


+ 1
- 4
src/app/RackScene.cpp View File

@@ -73,9 +73,6 @@ void RackScene::draw(NVGcontext *vg) {
}

Widget *RackScene::onHoverKey(Vec pos, int key) {
Widget *w = Widget::onHoverKey(pos, key);
if (w) return w;

switch (key) {
case GLFW_KEY_N:
if (guiIsModPressed() && !guiIsShiftPressed()) {
@@ -107,7 +104,7 @@ Widget *RackScene::onHoverKey(Vec pos, int key) {
break;
}

return NULL;
return Widget::onHoverKey(pos, key);
}




Loading…
Cancel
Save