| 33 | } |
| 34 | |
| 35 | void onSelectKey(const SelectKeyEvent& e) override { |
| 36 | if (e.action == GLFW_PRESS && (e.isKeyCommand(GLFW_KEY_ENTER) || e.isKeyCommand(GLFW_KEY_KP_ENTER))) { |
| 37 | engine::ParamQuantity* pq = paramWidget->getParamQuantity(); |
| 38 | assert(pq); |
| 39 | float oldValue = pq->getValue(); |
| 40 | if (pq) |
| 41 | pq->setDisplayValueString(text); |
| 42 | float newValue = pq->getValue(); |
| 43 | |
| 44 | if (oldValue != newValue) { |
| 45 | // Push ParamChange history action |
| 46 | history::ParamChange* h = new history::ParamChange; |
| 47 | h->moduleId = paramWidget->module->id; |
| 48 | h->paramId = paramWidget->paramId; |
| 49 | h->oldValue = oldValue; |
| 50 | h->newValue = newValue; |
| 51 | APP->history->push(h); |
| 52 | } |
| 53 | |
| 54 | ui::MenuOverlay* overlay = getAncestorOfType<ui::MenuOverlay>(); |
| 55 | overlay->requestDelete(); |
| 56 | e.consume(this); |
| 57 | } |
| 58 | |
| 59 | if (!e.getTarget()) |
| 60 | TextField::onSelectKey(e); |
| 61 | } |
| 62 | }; |
| 63 | |
| 64 |
nothing calls this directly
no test coverage detected