Overloads the mouse press event to handle special cases and \
        bypass when the scene is in view mode.
        
        :param      event   <QMousePressEvent>
339805
def mousePressEvent( self, event ):
        
        event.setAccepted(False)
        self._hotspotPressed = False
        # ignore events when the scene is in view mode
        scene = self.scene()
        if self.isLocked() or (scene and scene.inViewMode()):
            event.ignore()
            self._ignoreMouseEvents = True
            return
        
        self._ignoreMouseEvents = False
        
        # block the selection signals
        if scene:
            scene.blockSelectionSignals(True)
            
            # clear the selection
            if ( not (self.isSelected() or 
                      event.modifiers() == Qt.ControlModifier) ):
                for item in scene.selectedItems():
                    if ( item != self ):
                        item.setSelected(False)
        
        # determine if we need to start any connections
        hotspot = self.hotspotAt(event.pos())
        if hotspot and hotspot.isEnabled():
            hotspot.slot()(event)
        
            # check if the event is accepted
            if ( event.isAccepted() ):
                self._hotspotPressed = True
                return
        
        # try to start the connection
        event.accept()
        self._pressTime = datetime.datetime.now()
        super(XNode, self).mousePressEvent(event)
581334
def is_mouse_over(self, event):
        
        return event.x == self._x and self._y <= event.y < self._y + self._height
1091623
def mousePressEvent(self, event):
        """"""
        if self.mode == BuildMode:
            super(StimulusView, self).mousePressEvent(event)
        else:
            # select and de-select components
            index = self.indexAt(event.pos())
            if index.isValid():
                self.selectionModel().select(index, QtGui.QItemSelectionModel.Toggle)
                comp = self.model().data(index, AbstractDragView.DragRole)
                self.componentSelected.emit(comp)
                self.hintRequested.emit('Click components to toggle more members of auto-parameter\n\n-or-\n\nEdit fields of auto-parameter (parameter type should be selected first)')
110448
def mousePressEvent(self, event):
        """"""
        index = self.indexAt(event.pos())
        if index.isValid():
            self.selectRow(index.row())
            # selecting the row sets the current index to 0,0 for tab
            # order to work correctly, we must set the current index
            self.setCurrentIndex(index)
            self.parameterChanged.emit(self.model().selection(index))
            self.edit(index, QtGui.QAbstractItemView.DoubleClicked, event)
        super(AutoParameterTableView, self).mousePressEvent(event)
946211
def viewbox_mouse_event(self, event):
        
        # When the attached ViewBox reseives a mouse event, it is sent to the
        # camera here.
        
        self.mouse_pos = event.pos[:2]
        if event.type == 'mouse_wheel':
            # wheel rolled; adjust the magnification factor and hide the 
            # event from the superclass
            m = self.mag_target 
            m *= 1.2 ** event.delta[1]
            m = m if m > 1 else 1
            self.mag_target = m
        else:
            # send everything _except_ wheel events to the superclass
            super(MagnifyCamera, self).viewbox_mouse_event(event)
            
        # start the timer to smoothly modify the transform properties. 
        if not self.timer.running:
            self.timer.start()
        
        self._update_transform()
1370746
def mousePressEvent(self, event):
        """"""
        index = self.indexAt(event.pos())
        if index.isValid():
            if index.column() == 0:
                self.edit(index, QtGui.QAbstractItemView.DoubleClicked, event)
            else:
                super(ProtocolView, self).mousePressEvent(event)
1037772
def mouseMoveEvent( self, event ):
        
        event.setAccepted(False)
        if self._hotspotPressed:
            event.accept()
            return
        
        # ignore events when the scene is in view mode
        scene = self.scene()
        if ( self.isLocked() or self._ignoreMouseEvents or \
             (scene and (scene.inViewMode() or scene.isConnecting()))):
            event.ignore()
            self._ignoreMouseEvents = True
            return
        
        # call the base method
        event.accept()
        super(XNode, self).mouseMoveEvent(event)
1139377
def mousePressEvent(self, event):
        """"""
        if event.button() != Qt.LeftButton:
            QTableView.mousePressEvent(self, event)
            return
        index_clicked = self.indexAt(event.pos())
        if index_clicked.isValid():
            if index_clicked == self.currentIndex() \
               and index_clicked in self.selectedIndexes():
                self.clearSelection()
            else:
                QTableView.mousePressEvent(self, event)
        else:
            self.clearSelection()
            event.accept()
76102
def on_event(self, event):
        
        if self.state > 0:
            if event.type == MOUSEBUTTONDOWN:
                key = self.layout.get_key_at(pygame.mouse.get_pos())
                if key is not None:
                    self.on_key_down(key)
            elif event.type == MOUSEBUTTONUP:
                self.on_key_up()
            elif event.type == KEYDOWN:
                value = pygame.key.name(event.key)
                # TODO : Find from layout (consider checking layout key space ?)
            elif event.type == KEYUP:
                value = pygame.key.name(event.key)
181010
def _on_mouse_moved(self, event):
        
        if event.modifiers() & Qt.ControlModifier:
            self._select_word_under_mouse_cursor()
        else:
            self._remove_decoration()
            self.editor.set_mouse_cursor(Qt.IBeamCursor)
            self._previous_cursor_start = -1
            self._previous_cursor_end = -1
1281941
def keyPressEvent( self, event ):
        
        if ( self.scrollWidget().isHidden() ):
            if ( event.key() == Qt.Key_Escape ):
                self.cancelEdit()
                return
                
            elif ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
                self.acceptEdit()
                return
            
        elif ( event.key() == Qt.Key_A and 
               event.modifiers() == Qt.ControlModifier ):
            self.startEdit()
        
        super(XNavigationEdit, self).keyPressEvent(event)
939879
def on_mouse_event(self, event):
        ''''''
        pos = event.GetPosition()
        if event.RightDown() and self.popup_menu is not None:
            self.show_popup_menu(pos)
            return
        if event.Leaving():
            self.mouse_pos = None
        else:
            self.mouse_pos = pos

        if event.LeftDown():
            self.mouse_down = self.image_coordinates(pos)
        if event.Dragging() and event.ButtonIsDown(wx.MOUSE_BTN_LEFT):
            self.on_drag_event(event)
114531
def mouseMoveEvent(self, event):
        
        w = event.pos().x() - self._region.x()
        h = event.pos().y() - self._region.y()
        
        self._region.setWidth(w)
        self._region.setHeight(h)
        self.repaint()
        
        super(XSnapshotWidget, self).mouseMoveEvent(event)
400554
def mousePressEvent(self, event):
        
        super(XLineEdit, self).mousePressEvent(event)
        
        if self._focusedIn and self.selectAllOnFocus():
            self.selectAll()
            self._focusedIn = False
603959
def keyPressEvent(self, event):
        
        if event.key() in (Qt.Key_Enter, Qt.Key_Return):
            self.queryEntered.emit(self.query())
        
        super(XOrbQuickFilterWidget, self).keyPressEvent(event)
891277
def mousePressEvent(self, event):
        
        if event.button() == Qt.LeftButton:
            self._drag_origin = event.pos()
        widget = self.widget
        type(widget).mousePressEvent(widget, event)
698145
def _on_mouse_moved(self, event):
        
        if event.modifiers() & QtCore.Qt.ControlModifier:
            cursor = TextHelper(self.editor).word_under_mouse_cursor()
            if (not self._cursor or
                    cursor.position() != self._cursor.position()):
                self._check_word_cursor(cursor)
            self._cursor = cursor
        else:
            self._cursor = None
            self._clear_selection()