Scrolls the mouse if ROI Selection reaches corner of view

        :param mouse_x:
        :return:
559704
def scroll_mouse(self, mouse_x: int):
        
        scrollbar = self.horizontalScrollBar()

        if mouse_x - self.view_rect().x() > self.view_rect().width():
            scrollbar.setValue(scrollbar.value() + 5)

        elif mouse_x < self.view_rect().x():
            scrollbar.setValue(scrollbar.value() - 5)
165337
def cursor(self, pos):
        
        index = self.splitAt(pos)

        if len(self._rects[index[0]])-1 < index[1]:
            if index[1] == 0:
                # empty row
                x = 0
            else:
                rect = self._rects[index[0]][index[1]-1]
                x = rect.x() + rect.width()
        else:
            rect = self._rects[index[0]][index[1]]
            x = rect.x()

        y0 = index[0]*(ROW_HEIGHT + ROW_SPACE) + ROW_SPACE
        y1 = y0 + ROW_HEIGHT

        # adjust for scrolled viewport
        x -= self.horizontalScrollBar().value()
        y0 -= self.verticalScrollBar().value()
        y1 -= self.verticalScrollBar().value()
        
        return QtCore.QLine(x,y0,x,y1)
1318788
function mousemove_callback(e) {
            var x  = e.pageX || e.originalEvent.touches[0].pageX;
            var y  = e.pageY || e.originalEvent.touches[0].pageY;

            if (Math.abs(oX - x) > maxMove || Math.abs(oY - y) > maxMove) {
                if (timeout) clearTimeout(timeout);
            }
        }
889609
def on_mouse_move(self, event):
        """"""
        if event.modifiers:
            return
        if event.is_dragging:
            x0, y0 = self._normalize(event.press_event.pos)
            x1, y1 = self._normalize(event.last_event.pos)
            x, y = self._normalize(event.pos)
            dx, dy = x - x1, y - y1
            if event.button == 1:
                self.pan_delta((dx, dy))
            elif event.button == 2:
                c = np.sqrt(self.size[0]) * .03
                self.zoom_delta((dx, dy), (x0, y0), c=c)
532429
def _checkMousePositionForFocus(self):
        """"""
        i = 0
        cur_pos = pygame.mouse.get_pos()
        ml, mt = self.position
        for o in self.options:
            rect = o.get('label_rect')
            if rect:
                if rect.collidepoint(cur_pos) and self.mouse_pos != cur_pos:
                    self.option = i
                    self.mouse_pos = cur_pos
                    break
            i += 1
464226
def OnMouseWheel(self, event):
        

        if event.ControlDown():
            if event.WheelRotation > 0:
                post_command_event(self.grid, self.grid.ZoomInMsg)
            else:
                post_command_event(self.grid, self.grid.ZoomOutMsg)

        elif self.main_window.IsFullScreen():
            if event.WheelRotation > 0:
                newtable = self.grid.current_table - 1
            else:
                newtable = self.grid.current_table + 1

            post_command_event(self.grid, self.GridActionTableSwitchMsg,
                               newtable=newtable)
            return

        else:
            wheel_speed = config["mouse_wheel_speed_factor"]
            x, y = self.grid.GetViewStart()
            direction = wheel_speed if event.GetWheelRotation() < 0 \
                else -wheel_speed
            if event.ShiftDown():
                # Scroll sideways if shift is pressed.
                self.grid.Scroll(x + direction, y)
            else:
                self.grid.Scroll(x, y + direction)
704103
def _mouse_scroll_h(self, event):
        """"""
        args = (int(-1 * (event.delta / 120)), "units")
        self._canvas_scroll.xview_scroll(*args)
        self._canvas_ticks.xview_scroll(*args)
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()
341312
function onScroll() {
		// unique tick id
		++ticks;

		// viewport rectangle
		var top = jWindow.scrollTop(),
			left = jWindow.scrollLeft(),
			right = left + jWindow.width(),
			bottom = top + jWindow.height();

		// determine which elements are in view
//        + 60 accounts for fixed nav
		var intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);
		$.each(intersections, function(i, element) {

			var lastTick = element.data('scrollSpy:ticks');
			if (typeof lastTick != 'number') {
				// entered into view
				element.triggerHandler('scrollSpy:enter');
			}

			// update tick id
			element.data('scrollSpy:ticks', ticks);
		});

		// determine which elements are no longer in view
		$.each(elementsInView, function(i, element) {
			var lastTick = element.data('scrollSpy:ticks');
			if (typeof lastTick == 'number' && lastTick !== ticks) {
				// exited from view
				element.triggerHandler('scrollSpy:exit');
				element.data('scrollSpy:ticks', null);
			}
		});

		// remember elements in view for next tick
		elementsInView = intersections;
	}
1348234
def mouseMoved(self, viewPos):
        
        try:
            check_class(viewPos, QtCore.QPointF)
            self.crossLineVerShadow.setVisible(False)
            self.crossLineVertical.setVisible(False)
            self.probeLabel.setText("")
            self.probeDataItem.clear()

            if (self._hasValidData() and self.config.probeCti.configValue and
                self.viewBox.sceneBoundingRect().contains(viewPos)):

                scenePos = self.viewBox.mapSceneToView(viewPos)
                index = int(scenePos.x())
                data = self.slicedArray.data

                if not 0 <= index < len(data):
                    txt = "<span style='color: grey'>no data at cursor</span>"
                    self.probeLabel.setText(txt)
                else:
                    valueStr = to_string(data[index], masked=self.slicedArray.maskAt(index),
                                         maskFormat='&lt;masked&gt;')
                    self.probeLabel.setText("pos = {!r}, value = {}".format(index, valueStr))
                    if np.isfinite(data[index]):
                        self.crossLineVerShadow.setVisible(True)
                        self.crossLineVerShadow.setPos(index)
                        self.crossLineVertical.setVisible(True)
                        self.crossLineVertical.setPos(index)
                        if data[index] > 0 or self.config.yLogCti.configValue == False:
                            self.probeDataItem.setData((index,), (data[index],))

        except Exception as ex:
            # In contrast to _drawContents, this function is a slot and thus must not throw
            # exceptions. The exception is logged. Perhaps we should clear the cross plots, but
            # this could, in turn, raise exceptions.
            if DEBUGGING:
                raise
            else:
                logger.exception(ex)
615221
def mouse_zoom(self, inc):
        '''

        '''
        # Square Distance from pivot
        dsq = np.linalg.norm(self.position - self.pivot)
        minsq = 1.0**2  # How near can we be to the pivot
        maxsq = 7.0**2 # How far can we go 

        scalefac = 0.25

        if dsq > maxsq and inc < 0: 
            # We're going too far
            pass
        elif dsq < minsq and inc > 0:
            # We're going too close
            pass
        else:
            # We're golden
            self.position += self.c*inc*scalefac
1245661
def mouseMoveEvent(self, event):
        
        cursor = self.cursorForPosition(event.pos())
        self._last_mouse_pos = event.pos()
        block_found = False
        for sel in self.decorations:
            if sel.contains_cursor(cursor) and sel.tooltip:
                if (self._prev_tooltip_block_nbr != cursor.blockNumber() or
                        not QtWidgets.QToolTip.isVisible()):
                    pos = event.pos()
                    # add left margin
                    pos.setX(pos.x() + self.panels.margin_size())
                    # add top margin
                    pos.setY(pos.y() + self.panels.margin_size(0))
                    self._tooltips_runner.request_job(
                        self.show_tooltip,
                        self.mapToGlobal(pos), sel.tooltip[0: 1024], sel)
                    self._prev_tooltip_block_nbr = cursor.blockNumber()
                block_found = True
                break
        if not block_found and self._prev_tooltip_block_nbr != -1:
            QtWidgets.QToolTip.hideText()
            self._prev_tooltip_block_nbr = -1
            self._tooltips_runner.cancel_requests()
        self.mouse_moved.emit(event)
        super(CodeEdit, self).mouseMoveEvent(event)
68707
function onMouseWheel(e) {
       /* jshint expr:true */
       if (e.target === me.video.renderer.getScreenCanvas()) {
         // create a (fake) normalized event object
         e.type = "wheel"; // dispatch mouse event to registered object

         return dispatchEvent(normalizeEvent(e));
       }

       return true;
     }
639291
def index_at_event(self, event):
        
        # find index at mouse position
        globalpos = event.globalPos()
        viewport = self.viewport()
        pos = viewport.mapFromGlobal(globalpos)
        return self.indexAt(pos)
407334
def _mouse_scroll_v(self, event):
        """"""
        args = (int(-1 * (event.delta / 120)), "units")
        self._canvas_scroll.yview_scroll(*args)
        self._canvas_categories.yview_scroll(*args)
420071
function mouseActionLocal(angleXY) {
    encoder.azim = angleXY[0];
    encoder.elev = angleXY[1];
    encoder.updateGains();
}
716774
def mouseMoveEvent(self, event):
        
        c = self.cursorForPosition(event.pos())
        block = c.block()
        self._link_match = None
        self.viewport().setCursor(QtCore.Qt.IBeamCursor)
        for match in self.link_regex.finditer(block.text()):
            if not match:
                continue
            start, end = match.span()
            if start <= c.positionInBlock() <= end:
                self._link_match = match
                self.viewport().setCursor(QtCore.Qt.PointingHandCursor)
                break

        self._last_hovered_block = block
        super(OutputWindow, self).mouseMoveEvent(event)