Drag Start Handlers
979080
function(evt, x, y) {

        var view = this.getDelegatedView();
        if (!view || !view.can('elementMove')) return;

        this.eventData(evt, {
            action: 'move',
            delegatedView: view
        });

        view.eventData(evt, {
            x: x,
            y: y,
            restrictedArea: this.paper.getRestrictedArea(view)
        });
    }
917172
function(pref, down, move, up, cancel) {
				_dragStartEvent = pref + down;
				_dragMoveEvent = pref + move;
				_dragEndEvent = pref + up;
				if(cancel) {
					_dragCancelEvent = pref + cancel;
				} else {
					_dragCancelEvent = '';
				}
			}
345933
function handleStart(context) {

    var resizeConstraints = context.resizeConstraints,
        // evaluate minBounds for backwards compatibility
        minBounds = context.minBounds;

    if (resizeConstraints !== undefined) {
      return;
    }

    if (minBounds === undefined) {
      minBounds = self.computeMinResizeBox(context);
    }

    context.resizeConstraints = {
      min: asTRBL(minBounds)
    };
  }
857339
function(e) {
        this.logger.log("background drag");
        if (this.backgroundEnabled && !this.isLocked()) {
            var x = Event.getPageX(e),
                y = Event.getPageY(e);
            this.moveThumb(x, y, true, true);
            this.fireEvents();
        }
    }
1083061
def on_drag_motion(self, widget, context, x, y, time):
        
        hovered_item = ItemFinder(self.view.editor).get_item_at_point((x, y))
        if isinstance(hovered_item, NameView):
            hovered_item = hovered_item.parent
        if hovered_item is None:
            self.view.editor.unselect_all()
        elif isinstance(hovered_item.model, ContainerStateModel):
            if len(self.view.editor.selected_items) == 1 and hovered_item in self.view.editor.selected_items:
                return
            if len(self.view.editor.selected_items) > 0:
                self.view.editor.unselect_all()

            if not rafcon.gui.singleton.global_gui_config.get_config_value('DRAG_N_DROP_WITH_FOCUS'):
                self.view.editor.handler_block(self.focus_changed_handler_id)
            self.view.editor.focused_item = hovered_item
            if not rafcon.gui.singleton.global_gui_config.get_config_value('DRAG_N_DROP_WITH_FOCUS'):
                self.view.editor.handler_unblock(self.focus_changed_handler_id)
804944
function leftButtonStartDrag(cm, e, start, modifier) {
    var display = cm.display;
    var dragEnd = operation(cm, function(e2) {
      if (webkit) display.scroller.draggable = false;
      cm.state.draggingText = false;
      off(document, "mouseup", dragEnd);
      off(display.scroller, "drop", dragEnd);
      if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
        e_preventDefault(e2);
        if (!modifier)
          extendSelection(cm.doc, start);
        focusInput(cm);
        // Work around unexplainable focus problem in IE9 (#2127)
        if (ie && ie_version == 9)
          setTimeout(function() {document.body.focus(); focusInput(cm);}, 20);
      }
    });
    // Let the drag handler handle this.
    if (webkit) display.scroller.draggable = true;
    cm.state.draggingText = dragEnd;
    // IE's approach to draggable
    if (display.scroller.dragDrop) display.scroller.dragDrop();
    on(document, "mouseup", dragEnd);
    on(display.scroller, "drop", dragEnd);
  }
729175
def _start_drag_col(self, event):
        """"""
        # identify dragged column
        col = self.identify_column(event.x)
        self._dragged_col = ttk.Treeview.column(self, col, 'id')
        # get column width
        self._dragged_col_width = w = ttk.Treeview.column(self, col, 'width')
        # get x coordinate of the left side of the column
        x = event.x
        while self.identify_region(x, event.y) == 'heading':
            # decrease x until reaching the separator
            x -= 1
        x_sep = x
        w_sep = 0
        # determine separator width
        while self.identify_region(x_sep, event.y) == 'separator':
            w_sep += 1
            x_sep -= 1
        if event.x - x <= self._im_drag.width():
            # start dragging if mouse click was on dragging icon
            x = x - w_sep // 2 - 1
            self._dragged_col_x = x
            # get neighboring column widths
            displayed_cols = self._displayed_cols
            self._dragged_col_index = i1 = displayed_cols.index(self._dragged_col)
            if i1 > 0:
                left = ttk.Treeview.column(self, displayed_cols[i1 - 1], 'width')
            else:
                left = None
            if i1 < len(displayed_cols) - 1:
                right = ttk.Treeview.column(self, displayed_cols[i1 + 1], 'width')
            else:
                right = None
            self._dragged_col_neighbor_widths = (left, right)
            self._dx = x - event.x  # distance between cursor and column left border
            # configure dragged column preview
            self._visual_drag.column(self._dragged_col, width=w)
            self._visual_drag.configure(displaycolumns=[self._dragged_col])
            if 'headings' in tuple(str(p) for p in self['show']):
                self._visual_drag.configure(show='headings')
            else:
                self._visual_drag.configure(show='')
            self._visual_drag.place(in_=self, x=x, y=0, anchor='nw',
                                    width=w + 2, relheight=1)
            self._visual_drag.state(('active',))
            self._visual_drag.update_idletasks()
            self._visual_drag.yview_moveto(self.yview()[0])
        else:
            self._dragged_col = None
1258202
function(start, handler, arg) {
		this.global = true;
		this.descend(start, handler, arg);
		this.global = false;
	}
295857
function(evt) {
    var x = evt.containerPoint.x;
    var y = evt.containerPoint.y;

    var dx = x - this._startPoint.x;
    var dy = y - this._startPoint.y;

    if (!this._path._dragMoved && (dx || dy)) {
      this._path._dragMoved = true;
      this._path.fire('dragstart');
    }

    this._matrix[4] += dx;
    this._matrix[5] += dy;

    this._startPoint.x = x;
    this._startPoint.y = y;

    this._path._applyTransform(this._matrix);
    this._path.fire('drag');
    L.DomEvent.stop(evt.originalEvent);
  }
408757
def dragMoveEvent(self, event):
        """"""
        super(AbstractDragView, self).dragMoveEvent(event)
        if event.mimeData().hasFormat("application/x-protocol"):
            # find the nearest break to cursor
            self.dragline = self.cursor(event.pos())
            self.viewport().update()
            event.setDropAction(QtCore.Qt.MoveAction)
            event.accept()
        else:
            event.ignore()
854104
def dragLeaveEvent(self, event):
        """"""
        super(AbstractDragView, self).dragLeaveEvent(event)
        self.dragline = None
        self.viewport().update()
        event.accept()
1253979
public static void bindDragHandle(final RecyclerView.ViewHolder holder, final IExtendedDraggable item) {
        // if necessary, init the drag handle, which will start the drag when touched
        if (item.getTouchHelper() != null && item.getDragView(holder) != null) {
            item.getDragView(holder).setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View v, MotionEvent event) {
                    if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN) {
                        if (item.isDraggable())
                            item.getTouchHelper().startDrag(holder);
                    }
                    return false;
                }
            });
        }
    }
31022
protected void stopDragging() {

        clearScrollTimer();
        m_dragging = false;
        if (m_previewHandlerRegistration != null) {
            m_previewHandlerRegistration.removeHandler();
            m_previewHandlerRegistration = null;
        }
    }
597005
def dragMoveEvent(self, event):
        """"""
        index = self.indexAt(event.pos())
        if index:
            dst = self.get_filename(index)
            if osp.isdir(dst):
                event.acceptProposedAction()
            else:
                event.ignore()
        else:
            event.ignore()
933630
function setDOMEvents() {
			var lastWasOutsidePlot = true;
			/*
			 * Record the starting position of a dragoperation
			 */
			container.onmousedown = function (e) {
				e = normalizeMouseEvent(e);

				// issue #295, dragging not always working in Firefox
				if (!hasTouch && e.preventDefault) {
					e.preventDefault();
				}

				// record the start position
				chart.mouseIsDown = mouseIsDown = true;
				mouseDownX = e.chartX;
				mouseDownY = e.chartY;

				addEvent(doc, hasTouch ? 'touchend' : 'mouseup', drop);
			};

			// The mousemove, touchmove and touchstart event handler
			var mouseMove = function (e) {

				// let the system handle multitouch operations like two finger scroll
				// and pinching
				if (e && e.touches && e.touches.length > 1) {
					return;
				}

				// normalize
				e = normalizeMouseEvent(e);
				if (!hasTouch) { // not for touch devices
					e.returnValue = false;
				}

				var chartX = e.chartX,
					chartY = e.chartY,
					isOutsidePlot = !isInsidePlot(chartX - plotLeft, chartY - plotTop);

				// cache chart position for issue #149 fix
				if (!chartPosition) {
					chartPosition = getPosition(container);
				}

				// on touch devices, only trigger click if a handler is defined
				if (hasTouch && e.type === 'touchstart') {
					if (attr(e.target, 'isTracker')) {
						if (!chart.runTrackerClick) {
							e.preventDefault();
						}
					} else if (!runChartClick && !isOutsidePlot) {
						e.preventDefault();
					}
				}

				// cancel on mouse outside
				if (isOutsidePlot) {

					/*if (!lastWasOutsidePlot) {
						// reset the tracker
						resetTracker();
					}*/

					// drop the selection if any and reset mouseIsDown and hasDragged
					//drop();
					if (chartX < plotLeft) {
						chartX = plotLeft;
					} else if (chartX > plotLeft + plotWidth) {
						chartX = plotLeft + plotWidth;
					}

					if (chartY < plotTop) {
						chartY = plotTop;
					} else if (chartY > plotTop + plotHeight) {
						chartY = plotTop + plotHeight;
					}

				}

				if (mouseIsDown && e.type !== 'touchstart') { // make selection

					// determine if the mouse has moved more than 10px
					hasDragged = Math.sqrt(
						Math.pow(mouseDownX - chartX, 2) +
						Math.pow(mouseDownY - chartY, 2)
					);
					if (hasDragged > 10) {

						// make a selection
						if (hasCartesianSeries && (zoomX || zoomY) &&
								isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop)) {
							if (!selectionMarker) {
								selectionMarker = renderer.rect(
									plotLeft,
									plotTop,
									zoomHor ? 1 : plotWidth,
									zoomVert ? 1 : plotHeight,
									0
								)
								.attr({
									fill: optionsChart.selectionMarkerFill || 'rgba(69,114,167,0.25)',
									zIndex: 7
								})
								.add();
							}
						}

						// adjust the width of the selection marker
						if (selectionMarker && zoomHor) {
							var xSize = chartX - mouseDownX;
							selectionMarker.attr({
								width: mathAbs(xSize),
								x: (xSize > 0 ? 0 : xSize) + mouseDownX
							});
						}
						// adjust the height of the selection marker
						if (selectionMarker && zoomVert) {
							var ySize = chartY - mouseDownY;
							selectionMarker.attr({
								height: mathAbs(ySize),
								y: (ySize > 0 ? 0 : ySize) + mouseDownY
							});
						}
					}

				} else if (!isOutsidePlot) {
					// show the tooltip
					onmousemove(e);
				}

				lastWasOutsidePlot = isOutsidePlot;

				// when outside plot, allow touch-drag by returning true
				return isOutsidePlot || !hasCartesianSeries;
			};

			/*
			 * When the mouse enters the container, run mouseMove
			 */
			container.onmousemove = mouseMove;

			/*
			 * When the mouse leaves the container, hide the tracking (tooltip).
			 */
			addEvent(container, 'mouseleave', resetTracker);

			// issue #149 workaround
			// The mouseleave event above does not always fire. Whenever the mouse is moving
			// outside the plotarea, hide the tooltip
			addEvent(doc, 'mousemove', hideTooltipOnMouseMove);

			container.ontouchstart = function (e) {
				// For touch devices, use touchmove to zoom
				if (zoomX || zoomY) {
					container.onmousedown(e);
				}
				// Show tooltip and prevent the lower mouse pseudo event
				mouseMove(e);
			};

			/*
			 * Allow dragging the finger over the chart to read the values on touch
			 * devices
			 */
			container.ontouchmove = mouseMove;

			/*
			 * Allow dragging the finger over the chart to read the values on touch
			 * devices
			 */
			container.ontouchend = function () {
				if (hasDragged) {
					resetTracker();
				}
			};


			// MooTools 1.2.3 doesn't fire this in IE when using addEvent
			container.onclick = function (e) {
				var hoverPoint = chart.hoverPoint;
				e = normalizeMouseEvent(e);

				e.cancelBubble = true; // IE specific


				if (!hasDragged) {
					if (hoverPoint && attr(e.target, 'isTracker')) {
						var plotX = hoverPoint.plotX,
							plotY = hoverPoint.plotY;

						// add page position info
						extend(hoverPoint, {
							pageX: chartPosition.left + plotLeft +
								(inverted ? plotWidth - plotY : plotX),
							pageY: chartPosition.top + plotTop +
								(inverted ? plotHeight - plotX : plotY)
						});

						// the series click event
						fireEvent(hoverPoint.series, 'click', extend(e, {
							point: hoverPoint
						}));

						// the point click event
						hoverPoint.firePointEvent('click', e);

					} else {
						extend(e, getMouseCoordinates(e));

						// fire a click event in the chart
						if (isInsidePlot(e.chartX - plotLeft, e.chartY - plotTop)) {
							fireEvent(chart, 'click', e);
						}
					}


				}
				// reset mouseIsDown and hasDragged
				hasDragged = false;
			};

		}
746610
function _handleStart(e) {
      if (_settings('touchEnabled')) {
        var x0,
            x1,
            y0,
            y1,
            pos0,
            pos1;

        _downTouches = e.touches;

        switch (_downTouches.length) {
          case 1:
            _camera.isMoving = true;
            _touchMode = 1;

            _startCameraX = _camera.x;
            _startCameraY = _camera.y;

            _lastCameraX = _camera.x;
            _lastCameraY = _camera.y;

            pos0 = position(_downTouches[0]);
            _startTouchX0 = pos0.x;
            _startTouchY0 = pos0.y;

            break;
          case 2:
            _camera.isMoving = true;
            _touchMode = 2;

            pos0 = position(_downTouches[0]);
            pos1 = position(_downTouches[1]);
            x0 = pos0.x;
            y0 = pos0.y;
            x1 = pos1.x;
            y1 = pos1.y;

            _lastCameraX = _camera.x;
            _lastCameraY = _camera.y;

            _startCameraAngle = _camera.angle;
            _startCameraRatio = _camera.ratio;

            _startCameraX = _camera.x;
            _startCameraY = _camera.y;

            _startTouchX0 = x0;
            _startTouchY0 = y0;
            _startTouchX1 = x1;
            _startTouchY1 = y1;

            _startTouchAngle = Math.atan2(
              _startTouchY1 - _startTouchY0,
              _startTouchX1 - _startTouchX0
            );
            _startTouchDistance = Math.sqrt(
              (_startTouchY1 - _startTouchY0) *
                (_startTouchY1 - _startTouchY0) +
              (_startTouchX1 - _startTouchX0) *
                (_startTouchX1 - _startTouchX0)
            );

            e.preventDefault();
            return false;
        }
      }
    }
98472
function dragHandler(event) {
            dragging.released = event.type === 'mouseup' || event.type === 'touchend';
            dragging.path     = within(
                (dragging.touch ? event.originalEvent[dragging.released ? 'changedTouches' : 'touches'][0] : event)[o.horizontal ? 'pageX' : 'pageY'] - dragging.initLoc,
                dragging.pathMin, dragging.pathMax
            );

            // Initialization
            if (!dragging.init && (Math.abs(dragging.path) > (dragging.touch ? 50 : 10) || dragging.source === 'handle')) {
                dragging.init = 1;
                if (dragging.source === 'slidee') {
                    ignoreNextClick = 1;
                }

                // Pause ongoing cycle
                self.pause(1);

                // Disable click actions on source element, as they are unwelcome when dragging
                dragging.$source.on('click', function disableAction(event) {
                    stopDefault(event, 1);
                    if (dragging.source === 'slidee') {
                        ignoreNextClick = 0;
                    }
                    dragging.$source.off('click', disableAction);
                });

                // Trigger moveStart event
                trigger('moveStart');
            }

            // Proceed when initialized
            if (dragging.init) {
                stopDefault(event);

                // Adjust path with a swing on mouse release
                if (dragging.released && dragging.source === 'slidee' && o.speed > 33) {
                    dragging.path += dragging.path * 200 / (+new Date() - dragging.start);
                }

                slideTo(dragging.source === 'slidee' ? Math.round(dragging.initPos - dragging.path) : handleToSlidee(dragging.initPos + dragging.path));
            }

            // Cleanup and trigger :moveEnd event on release
            if (dragging.released) {
                $doc.off(dragging.touch ? dragTouchEvents : dragMouseEvents, dragHandler);
                (dragging.source === 'slidee' ? $slidee : $handle).removeClass(o.draggedClass);

                // Account for item snapping position adjustment.
                if (pos.cur === pos.dest) {
                    trigger('moveEnd');
                }
            }
        }