Skip to content

Commit

Permalink
fix alt click for nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
7174Andy committed Dec 20, 2024
1 parent 44ee11d commit 69e9f50
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sleap/gui/widgets/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -2126,9 +2126,7 @@ def hoverLeaveEvent(self, event):
return super().hoverLeaveEvent(event)

def mousePressEvent(self, event):
"""Custom event handler for mouse press.
This method is called when the user clicks on the labeled instance."""
"""Custom event handler for mouse press."""
if event.buttons() == Qt.LeftButton:
if event.modifiers() == Qt.ControlModifier:
self._duplicate_instance()
Expand Down Expand Up @@ -2185,8 +2183,9 @@ def mouseMoveEvent(self, event):
"""Custom event handler to emit signal on event."""
is_move = self.flags() & QGraphicsItem.ItemIsMovable
is_ctrl_pressed = (event.modifiers() & Qt.ControlModifier) == Qt.ControlModifier
is_alt_pressed = (event.modifiers() & Qt.AltModifier) == Qt.AltModifier

if is_move and is_ctrl_pressed:
if is_move and (is_ctrl_pressed or is_alt_pressed):
super().mouseMoveEvent(event)

def mouseReleaseEvent(self, event):
Expand Down

0 comments on commit 69e9f50

Please sign in to comment.