| 387 | |
| 388 | |
| 389 | void PortWidget::onButton(const ButtonEvent& e) { |
| 390 | OpaqueWidget::onButton(e); |
| 391 | |
| 392 | if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_RIGHT) { |
| 393 | createContextMenu(); |
| 394 | e.consume(this); |
| 395 | return; |
| 396 | } |
| 397 | |
| 398 | if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT) { |
| 399 | deleteTopCableAction(); |
| 400 | // Consume null so onDragStart isn't triggered |
| 401 | e.consume(NULL); |
| 402 | return; |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | |
| 407 | void PortWidget::onEnter(const EnterEvent& e) { |