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

Method onButton

src/app/PortWidget.cpp:125–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 CableWidget* cw;
124
125 void onButton(const ButtonEvent& e) override {
126 OpaqueWidget::onButton(e);
127 if (disabled)
128 return;
129 if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & RACK_MOD_MASK) == 0) {
130 // Set PortWidget::onDragStart overrides
131 pw->internal->overrideCws.push_back(cw);
132
133 // Pretend the PortWidget was clicked
134 e.consume(pw);
135 // Deletes `this`
136 doAction();
137 }
138 }
139
140 ui::Menu* createChildMenu() override {
141 ui::Menu* menu = new ui::Menu;

Callers

nothing calls this directly

Calls 1

consumeMethod · 0.80

Tested by

no test coverage detected