def keyPressEvent(self, event):
        """ Handles the key press event """
        key = event.key()
        modifiers = int(event.modifiers())
        if modifiers in self.__hotKeys:
            if key in self.__hotKeys[modifiers]:
                self.__hotKeys[modifiers][key]()
                event.accept()
                return

        QGraphicsScene.keyPressEvent(self, event)
        return
Beispiel #2
0
    def keyPressEvent(self, event):
        """ Handles the key press event """
        key = event.key()
        modifiers = int(event.modifiers())
        if modifiers in self.__hotKeys:
            if key in self.__hotKeys[modifiers]:
                self.__hotKeys[modifiers][key]()
                event.accept()
                return

        QGraphicsScene.keyPressEvent(self, event)
        return
Beispiel #3
0
    def keyPressEvent(self, keyEvent):
        QGraphicsScene.keyPressEvent(self, keyEvent)

        if keyEvent.key() == Qt.Key_Control:
            self.__view.setDragMode(QGraphicsView.ScrollHandDrag)
            self.__isControlModifier = True

        if keyEvent.key() == Qt.Key_Alt:
            self.__isAltModifier = True
            self.__previousSelectedNode = None

        if keyEvent.key() == 88:
            self.__kDummy.setSnapMode(True)
Beispiel #4
0
    def keyPressEvent(self, keyEvent):
        QGraphicsScene.keyPressEvent(self, keyEvent)

        if keyEvent.key() == Qt.Key_Control:
            self.__view.setDragMode(QGraphicsView.ScrollHandDrag)
            self.__isControlModifier = True

        if keyEvent.key() == Qt.Key_Alt:
            self.__isAltModifier = True
            self.__previousSelectedNode = None

        if keyEvent.key() == 88:
            self.__kDummy.setSnapMode(True)
Beispiel #5
0
 def keyPressEvent(self, event):
     if self.user_interaction_handler and \
             self.user_interaction_handler.keyPressEvent(event):
         return
     return QGraphicsScene.keyPressEvent(self, event)