From 69e9f5042e9bc5b09a6ecd073e132947410ab92d Mon Sep 17 00:00:00 2001 From: 7174Andy Date: Fri, 20 Dec 2024 09:58:11 -0800 Subject: [PATCH] fix alt click for nodes --- sleap/gui/widgets/video.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sleap/gui/widgets/video.py b/sleap/gui/widgets/video.py index 7dddd2919..8a27f35d3 100644 --- a/sleap/gui/widgets/video.py +++ b/sleap/gui/widgets/video.py @@ -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() @@ -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):