MCPcopy Create free account
hub / github.com/VCVRack/Rack / onButton

Method onButton

src/app/PortWidget.cpp:202–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200 size_t colorId;
201
202 void onButton(const ButtonEvent& e) override {
203 OpaqueWidget::onButton(e);
204 if (disabled)
205 return;
206 if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & RACK_MOD_MASK) == 0) {
207 APP->scene->rack->setNextCableColorId(colorId);
208 // Set PortWidget::onDragStart overrides
209 pw->internal->overrideCreateCable = true;
210
211 // Pretend the PortWidget was clicked
212 e.consume(pw);
213 // Deletes `this`
214 doAction();
215 }
216 }
217};
218
219

Callers

nothing calls this directly

Calls 2

setNextCableColorIdMethod · 0.80
consumeMethod · 0.80

Tested by

no test coverage detected