Creates the drag event for this item.
        
        :param      event | <QMousePressEvent>
336009
def mousePressEvent(self, event):
        
        near_x, near_y = self.nearestPoint(event.pos())
        
        data = self.dragData(x=near_x, y=near_y)
        self.startDrag(data)
        
        super(XChartWidgetItem, self).mousePressEvent(event)
976863
def dragEnterEvent(self, event):
        

        LOGGER.debug("> '{0}' widget drag enter event accepted!".format(self.__class__.__name__))
        event.accept()
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)
583743
def mousePressEvent(self, event):
        
        # ignore events when the scene is in view mode
        scene = self.scene()
        if scene and scene.inViewMode():
            event.ignore()
            return

        # 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)

        # try to start the connection
        super(XNodeConnection, self).mousePressEvent(event)
1371634
def keyPressEvent( self, event ):
        
        if ( event.key() == Qt.Key_C and \
             event.modifiers() == Qt.ControlModifier ):
            self.copy()
            event.accept()
            return
            
        elif ( event.key() == Qt.Key_V and \
             event.modifiers() == Qt.ControlModifier ):
            self.paste()
            event.accept()
            return
        
        elif ( event.key() == Qt.Key_Delete ):
            indexes = map(self.row, self.selectedItems())
            for index in reversed(sorted(indexes)):
                self.takeItem(index)
            
            event.accept()
            return
        
        elif event.key() == Qt.Key_Backspace:
            if self.count() > 1:
                self.takeItem(self.count() - 2)
                self.setFocus()
        
        super(XMultiTagEdit, self).keyPressEvent(event)
1204644
function(e) {
        if (this._dragging) return;
        this._dragging = true;

        // TODO: remove this and instead lock on pointer control events in future
        Crafty.s("Mouse").bind("MouseMove", this._ondrag);
        Crafty.s("Mouse").bind("MouseUp", this._onup);

        // if event undefined, use the last known position of the mouse
        this.trigger("StartDrag", e || Crafty.s("Mouse").lastMouseEvent);
        return this;
    }
1136115
function handler ( event ){
	var elem = this, returned, data = event.data || {};
	// mousemove or mouseup
	if ( data.elem ){
		// update event properties...
		elem = event.dragTarget = data.elem; // drag source element
		event.dragProxy = drag.proxy || elem; // proxy element or source
		event.cursorOffsetX = data.pageX - data.left; // mousedown offset
		event.cursorOffsetY = data.pageY - data.top; // mousedown offset
		event.offsetX = event.pageX - event.cursorOffsetX; // element offset
		event.offsetY = event.pageY - event.cursorOffsetY; // element offset
		}
	// mousedown, check some initial props to avoid the switch statement
	else if ( drag.dragging || ( data.which>0 && event.which!=data.which ) ||
		$( event.target ).is( data.not ) ) return;
	// handle various events
	switch ( event.type ){
		// mousedown, left click, event.target is not restricted, init dragging
		case 'mousedown':
			$.extend( data, $( elem ).offset(), {
				elem: elem, target: event.target,
				pageX: event.pageX, pageY: event.pageY
				}); // store some initial attributes
			$event.add( document, "mousemove mouseup", handler, data );
			selectable( elem, false ); // disable text selection
			drag.dragging = null; // pending state
			break; // prevents text selection in safari
		// mousemove, check distance, start dragging
		case !drag.dragging && 'mousemove':
			if ( squared( event.pageX-data.pageX )
				+ squared( event.pageY-data.pageY ) //  x² + y² = distance²
				< data.distance ) break; // distance tolerance not reached
			event.target = data.target; // force target from "mousedown" event (fix distance issue)
			returned = hijack( event, "dragstart", elem ); // trigger "dragstart", return proxy element
			if ( returned !== false ){ // "dragstart" not rejected
				drag.dragging = elem; // activate element
				drag.proxy = event.dragProxy = $( returned || elem )[0]; // set proxy
				}
		// mousemove, dragging
		case 'mousemove':
			if ( drag.dragging ){
				returned = hijack( event, "drag", elem ); // trigger "drag"
				if ( data.drop && $special.drop ){ // manage drop events
					$special.drop.allowed = ( returned !== false ); // prevent drop
					$special.drop.handler( event ); // "dropstart", "dropend"
					}
				if ( returned !== false ) break; // "drag" not rejected, stop
				event.type = "mouseup"; // helps "drop" handler behave
				}
		// mouseup, stop dragging
		case 'mouseup':
			$event.remove( document, "mousemove mouseup", handler ); // remove page events
			if ( drag.dragging ){
				if ( data.drop && $special.drop ) $special.drop.handler( event ); // "drop"
				hijack( event, "dragend", elem ); // trigger "dragend"
				}
			selectable( elem, true ); // enable text selection
			drag.dragging = drag.proxy = data.elem = false; // deactivate element
			break;
		}
	}
1044369
public void onMouseDown(MouseDownEvent event) {
		FeatureTransaction featureTransaction = getFeatureTransaction();
		if (featureTransaction != null && parent.getEditMode() == EditMode.DRAG_MODE
				&& event.getNativeButton() != Event.BUTTON_RIGHT) {
			String targetId = getTargetId(event);
			if (TransactionGeomIndexUtil.isVertex(targetId)) {
				dragTargetId = targetId;
				if (dragTransaction == null) {
					dragTransaction = (FeatureTransaction) featureTransaction.clone();
				}
				mapWidget.render(featureTransaction, RenderGroup.VECTOR, RenderStatus.DELETE);
				mapWidget.render(dragTransaction, RenderGroup.VECTOR, RenderStatus.ALL);
				createTempLines(featureTransaction, event);
			}
		}
	}
425129
def event(self, event):
        
        if event.type() == QEvent.KeyPress:
            if (event.key() == Qt.Key_Tab or event.key() == Qt.Key_Space):
                text = self.text()
                cursor = self.cursorPosition()
                # fix to include in "undo/redo" history
                if cursor != 0 and text[cursor-1] == ' ':
                    text = text[:cursor-1] + ROW_SEPARATOR + ' ' +\
                        text[cursor:]
                else:
                    text = text[:cursor] + ' ' + text[cursor:]
                self.setCursorPosition(cursor)
                self.setText(text)
                self.setCursorPosition(cursor + 1)
                return False
        return QWidget.event(self, event)
1358531
def mousePressEvent(self, event):
        """"""
        super(AbstractDragView, self).mousePressEvent(event)
        self.dragStartPosition = event.pos()
445396
def dragMoveEvent( self, event ):
        
        filt = self.dragDropFilter()
        if not filt:
            super(XTreeWidget, self).dragMoveEvent(event)
            return
        
        filt(self, event)
475720
def mousePressEvent(self, event):
        
        ddata = self.dataset().dragData()
        if ddata:
            self.startDrag(ddata)
        
        super(XChartDatasetItem, self).mousePressEvent(event)
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)
849620
def keyPressEvent( self, event ):
        
        if ( event.key() in (Qt.Key_Enter, Qt.Key_Return) ):
            self.emitSaveRequested()
        
        super(XQueryBuilderWidget, self).keyPressEvent(event)
619774
def keyPressEvent(self, event):
        
        # reject on a cancel
        if event.key() == Qt.Key_Escape:
            self.reject()
        
        super(XSnapshotWidget, self).keyPressEvent(event)
291411
@Override
	public void onDown(HumanInputEvent<?> event) {
		if (dragging && leftWidget) {
			// mouse was moved outside of widget
			doSelect(event);

		} else if (!isRightMouseButton(event)) {
			// no point trying to select when there is no active layer
			dragging = true;
			leftWidget = false;
			timestamp = new Date().getTime();
			begin = getLocation(event, RenderSpace.SCREEN);
			bounds = new Bbox(begin.getX(), begin.getY(), 0.0, 0.0);
			shift = event.isShiftKeyDown();
			rectangle = new Rectangle("selectionRectangle");
			rectangle.setStyle(rectangleStyle);
			rectangle.setBounds(bounds);
			mapWidget.render(rectangle, RenderGroup.SCREEN, RenderStatus.UPDATE);
		}
	}
819638
def enterEvent( self, event ):
        
        item = self.trackerItem()
        if ( item ):
            item.setVisible(True)