diff --git a/source/frontend/patchcanvas/scene.py b/source/frontend/patchcanvas/scene.py index e7b26724f..2761350c1 100644 --- a/source/frontend/patchcanvas/scene.py +++ b/source/frontend/patchcanvas/scene.py @@ -280,6 +280,10 @@ class PatchScene(QGraphicsScene): ) self.m_mouse_rubberband = False + # FIXME stop using self.m_ctrl_down + if event.modifiers() & Qt.ControlModifier: + self.m_ctrl_down = True + if event.button() == Qt.MidButton and self.m_ctrl_down: self.m_mid_button_down = True self.startConnectionCut() diff --git a/source/frontend/widgets/draggablegraphicsview.py b/source/frontend/widgets/draggablegraphicsview.py index d06c941d6..212c20e19 100644 --- a/source/frontend/widgets/draggablegraphicsview.py +++ b/source/frontend/widgets/draggablegraphicsview.py @@ -36,7 +36,6 @@ class DraggableGraphicsView(QGraphicsView): QGraphicsView.__init__(self, parent) self.fPanning = False - self.fCtrlDown = False try: self.fMiddleButton = Qt.MiddleButton @@ -73,7 +72,6 @@ class DraggableGraphicsView(QGraphicsView): def dragEnterEvent(self, event): urls = event.mimeData().urls() - print(urls) for url in urls: if self.isDragUrlValid(url.toLocalFile()): @@ -116,7 +114,7 @@ class DraggableGraphicsView(QGraphicsView): # -------------------------------------------------------------------------------------------------------- def mousePressEvent(self, event): - if event.button() == self.fMiddleButton and not self.fCtrlDown: + if event.button() == self.fMiddleButton and not (event.modifiers() & Qt.ControlModifier): buttons = event.buttons() buttons &= ~self.fMiddleButton buttons |= Qt.LeftButton @@ -154,13 +152,3 @@ class DraggableGraphicsView(QGraphicsView): QGraphicsView.wheelEvent(self, event) # -------------------------------------------------------------------------------------------------------- - - def keyPressEvent(self, event): - if event.key() == Qt.Key_Control: - self.fCtrlDown = True - QGraphicsView.keyPressEvent(self, event) - - def keyReleaseEvent(self, event): - if event.key() == Qt.Key_Control: - self.fCtrlDown = False - QGraphicsView.keyReleaseEvent(self, event)