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

Method onButton

src/app/PortWidget.cpp:88–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 CableWidget* cw;
87
88 void onButton(const ButtonEvent& e) override {
89 OpaqueWidget::onButton(e);
90 if (disabled)
91 return;
92 if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & RACK_MOD_MASK) == 0) {
93 // Set PortWidget::onDragStart overrides
94 pw->internal->overrideCloneCw = cw;
95
96 // Pretend the PortWidget was clicked
97 e.consume(pw);
98 // Deletes `this`
99 doAction();
100 }
101 }
102};
103
104

Callers

nothing calls this directly

Calls 1

consumeMethod · 0.80

Tested by

no test coverage detected