Reports left and right mouse button releases + position
979209
def mouse_release_event(self, x, y, button):
        """"""
        if button == 1:
            print("Left mouse button released @", x, y)
        if button == 2:
            print("Right mouse button released @", x, y)
509780
function mousemove(event) {
                    // Prevent default dragging of selected content
                    event.preventDefault();
                    // Move helper
                    moveSelectionHelper(helper, startX, startY, event.pageX, event.pageY);
                    // Check items is selecting
                    var childs = getSelectableElements(element);
                    for (var i = 0; i < childs.length; i++) {
                        if (checkElementHitting(transformBox(offset(childs[i][0]).left, offset(childs[i][0]).top, offset(childs[i][0]).left + childs[i].prop('offsetWidth'), offset(childs[i][0]).top + childs[i].prop('offsetHeight')), transformBox(startX, startY, event.pageX, event.pageY))) {
                            if (childs[i].scope().isSelecting === false) {
                                childs[i].scope().isSelecting = true;
                                childs[i].scope().$apply();
                            }
                        } else {
                            if (childs[i].scope().isSelecting === true) {
                                childs[i].scope().isSelecting = false;
                                childs[i].scope().$apply();
                            }
                        }
                    }
                }
548347
function (pos, event) {
          // mouse position last events
          pos.lastX = pos.nowX;
          pos.lastY = pos.nowY;

          // mouse position this events
          pos.nowX = event.pageX;
          pos.nowY = event.pageY;

          // distance mouse moved between events
          pos.distX = pos.nowX - pos.lastX;
          pos.distY = pos.nowY - pos.lastY;

          // direction mouse was moving
          pos.lastDirX = pos.dirX;
          pos.lastDirY = pos.dirY;

          // direction mouse is now moving (on both axis)
          pos.dirX = pos.distX === 0 ? 0 : pos.distX > 0 ? 1 : -1;
          pos.dirY = pos.distY === 0 ? 0 : pos.distY > 0 ? 1 : -1;

          // axis mouse is now moving on
          var newAx = Math.abs(pos.distX) > Math.abs(pos.distY) ? 1 : 0;

          // calc distance moved on this axis (and direction)
          if (pos.dirAx !== newAx) {
            pos.distAxX = 0;
            pos.distAxY = 0;
          } else {
            pos.distAxX += Math.abs(pos.distX);
            if (pos.dirX !== 0 && pos.dirX !== pos.lastDirX) {
              pos.distAxX = 0;
            }

            pos.distAxY += Math.abs(pos.distY);
            if (pos.dirY !== 0 && pos.dirY !== pos.lastDirY) {
              pos.distAxY = 0;
            }
          }
          pos.dirAx = newAx;
        }
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)
1189231
def _handle_mouse(self, ev):
        
        FROM_LEFT_1ST_BUTTON_PRESSED = 0x1

        result = []

        # Check event type.
        if ev.ButtonState == FROM_LEFT_1ST_BUTTON_PRESSED:
            # On a key press, generate both the mouse down and up event.
            for event_type in [MouseEventType.MOUSE_DOWN, MouseEventType.MOUSE_UP]:
                data = ';'.join([
                   event_type,
                   str(ev.MousePosition.X),
                   str(ev.MousePosition.Y)
                ])
                result.append(KeyPress(Keys.WindowsMouseEvent, data))

        return result
1168257
def mouse_press_event(self, event):
        
        # Support left and right mouse button for now
        if event.button() not in [1, 2]:
            return

        self.example.mouse_press_event(event.x(), event.y(), event.button())
1069896
def mouse_press_event(self, x, y, button):
        """"""
        if button == 1:
            print("Left mouse button pressed @", x, y)
        if button == 2:
            print("Right mouse button pressed @", x, y)
306532
@Override
	public void mouseMoveOut() throws WidgetException {
		try {
	        // TODO: Need to figure out whether 10 is sufficient
	        int offsetAmount = 10;

	        WebElement elem = getWebElement();
	        Dimension dim = elem.getSize();
	        int width = dim.getWidth();
	        Actions builder = new Actions(getGUIDriver().getWrappedDriver());
	        synchronized (InteractiveElement.class) {
	            getGUIDriver().focus();
	            builder.moveToElement(getWebElement(), width + offsetAmount, 0).build().perform();
	        }
		} catch (Exception e) {
			throw new WidgetException("Error while performing mouse move out",
					getByLocator(), e);
		}
	}
1129924
function(evt)
	{
		return mxEvent.isRightMouseButton(evt) || (mxClient.IS_MAC && mxEvent.isControlDown(evt) &&
			!mxEvent.isShiftDown(evt) && !mxEvent.isMetaDown(evt) && !mxEvent.isAltDown(evt));
	}
957523
def emit_mouse(self, report):
        """"""
        for name, attr in self.layout.mouse.items():
            # If the attr is a tuple like (left_analog_y, "-")
            # then set the attr to just be the first item
            attr, modifier = attr

            if attr.startswith("trackpad_touch"):
                active_attr = attr[:16] + "active"
                if not getattr(report, active_attr):
                    self.mouse_pos.pop(name, None)
                    continue

                pos = getattr(report, attr)
                if name not in self.mouse_pos:
                    self.mouse_pos[name] = pos

                sensitivity = 0.5
                self.mouse_rel[name] += (pos - self.mouse_pos[name]) * sensitivity
                self.mouse_pos[name] = pos

            elif "analog" in attr:
                pos = getattr(report, attr)
                if (pos > (128 + self.mouse_analog_deadzone)
                    or pos < (128 - self.mouse_analog_deadzone)):
                    accel = (pos - 128) / 10
                else:
                    continue

                # If a minus modifier has been given then minus the acceleration
                # to invert the direction.
                if (modifier and modifier == "-"):
                    accel = -accel

                sensitivity = self.mouse_analog_sensitivity
                self.mouse_rel[name] += accel * sensitivity

            # Emulate mouse wheel (needs special handling)
            if name in (ecodes.REL_WHEELUP, ecodes.REL_WHEELDOWN):
                ecode = ecodes.REL_WHEEL # The real event we need to emit
                write = False
                if getattr(report, attr):
                    self._scroll_details['direction'] = name
                    now = time.time()
                    last_write = self._scroll_details.get('last_write')
                    if not last_write:
                        # No delay for the first button press for fast feedback
                        write = True
                        self._scroll_details['count'] = 0
                    if name == ecodes.REL_WHEELUP:
                        value = 1
                    elif name == ecodes.REL_WHEELDOWN:
                        value = -1
                    if last_write:
                        # Delay at least one cycle before continual scrolling
                        if self._scroll_details['count'] > 1:
                            if now - last_write > self.scroll_delay:
                                write = True
                        elif now - last_write > self.scroll_repeat_delay:
                            write = True
                    if write:
                        self.device.write(ecodes.EV_REL, ecode, value)
                        self._scroll_details['last_write'] = now
                        self._scroll_details['count'] += 1
                        continue # No need to proceed further
                else:
                    # Reset so you can quickly tap the button to scroll
                    if self._scroll_details.get('direction') == name:
                        self._scroll_details['last_write'] = 0
                        self._scroll_details['count'] = 0

            rel = int(self.mouse_rel[name])
            self.mouse_rel[name] = self.mouse_rel[name] - rel
            self.device.write(ecodes.EV_REL, name, rel)

        self.device.syn()
607929
function onMouseDown (ev) {
      var canvasOffset = display._getCanvasOffset();
      _triggerCallbacks({
         'type': exports.MOUSE_DOWN,
         'pos': [ev.clientX - canvasOffset[0], ev.clientY - canvasOffset[1]],
         'button': ev.button,
         'shiftKey': ev.shiftKey,
         'ctrlKey': ev.ctrlKey,
         'metaKey': ev.metaKey
      });
   }
27992
def _on_mouse_released(self, event):
        
        if event.button() == 1 and self._deco:
            cursor = TextHelper(self.editor).word_under_mouse_cursor()
            if cursor and cursor.selectedText():
                self._timer.request_job(
                    self.word_clicked.emit, cursor)
721211
def _right_click(self, event):
        """"""
        iid = self.current_iid
        if iid is None:
            if self._menu is not None:
                self._menu.post(event.x, event.y)
            return
        args = (iid, (event.x_root, event.y_root))
        self.call_callbacks(iid, "right_callback", args)
        tags = list(self.marker_tags(iid))
        if len(tags) == 0:
            return
        menu = self._tags[tags[-1]].get("menu", None)
        if menu is None or not isinstance(menu, tk.Menu):
            return
        menu.post(event.x_root, event.y_root)
421379
def on_button_press(self, event):
        
        if event.get_button()[1] not in self._buttons:
            return False  # Only handle events for registered buttons (left mouse clicks)

        if event.get_state()[1] & constants.RUBBERBAND_MODIFIER:
            return False  # Mouse clicks with pressed shift key are handled in another tool

        # Special case: moving the NameView
        # This is only allowed, if the hovered item is a NameView and the Ctrl-key is pressed and the only selected
        # item is the parental StateView. In this case, the selection and _item will no longer be looked at,
        # but only _move_name_v
        self._item = self.get_item()
        if isinstance(self._item, NameView):
            selected_items = self.view.selected_items
            if event.get_state()[1] & Gdk.ModifierType.CONTROL_MASK and len(selected_items) == 1 and next(iter(selected_items)) is \
                    self._item.parent:
                self._move_name_v = True
            else:
                self._item = self._item.parent

        if not self._move_name_v:
            self._old_selection = self.view.selected_items
            if self._item not in self.view.selected_items:
                # When items are to be moved, a button-press should not cause any deselection.
                # However, the selection is stored, in case no move operation is performed.
                self.view.handle_new_selection(self._item)

        if not self.view.is_focus():
            self.view.grab_focus()

        return True
1089077
function () {
    removeEvent(docBody, 'mousemove');
    if (cPRender) {
      clearInterval(cPRender);
      cPRender = false;
      doRender(true, true)
    }
    cP.cPSL4.className = 'cPSL4'; // cursor to normal
    cP.cPResizers.cssText = '';
    // cP.cObj.osXY = 'left:'+cP.style.left+';top:'+cP.style.top+';'; // save position
    cP.cObj.osX = cP.style.left;
    cP.cObj.osY = cP.style.top; // save position
    if (cP.inp) cP.inp.className = '';
  }
792688
def mouseGestureHandler(self, info):
        
        print(self.pre, ": mouseGestureHandler: ")
        # *** single click events ***
        if (info.fsingle):
            print(self.pre, ": mouseGestureHandler: single click")
            if (info.button == QtCore.Qt.LeftButton):
                print(self.pre, ": mouseGestureHandler: Left button clicked")
            elif (info.button == QtCore.Qt.RightButton):
                print(self.pre, ": mouseGestureHandler: Right button clicked")
                self.handle_right_single_click(info)
        # *** double click events ***
        elif (info.fdouble):
            if (info.button == QtCore.Qt.LeftButton):
                print(
                    self.pre,
                    ": mouseGestureHandler: Left button double-clicked")
                self.handle_left_double_click(info)
            elif (info.button == QtCore.Qt.RightButton):
                print(
                    self.pre,
                    ": mouseGestureHandler: Right button double-clicked")
619508
def on_mouse_press(self, x, y, buttons, modifiers):
        
        self.view['ball'].set_state(Trackball.STATE_ROTATE)
        if (buttons == pyglet.window.mouse.LEFT):
            ctrl = (modifiers & pyglet.window.key.MOD_CTRL)
            shift = (modifiers & pyglet.window.key.MOD_SHIFT)
            if (ctrl and shift):
                self.view['ball'].set_state(Trackball.STATE_ZOOM)
            elif shift:
                self.view['ball'].set_state(Trackball.STATE_ROLL)
            elif ctrl:
                self.view['ball'].set_state(Trackball.STATE_PAN)
        elif (buttons == pyglet.window.mouse.MIDDLE):
            self.view['ball'].set_state(Trackball.STATE_PAN)
        elif (buttons == pyglet.window.mouse.RIGHT):
            self.view['ball'].set_state(Trackball.STATE_ZOOM)

        self.view['ball'].down(np.array([x, y]))
        self.scene.camera.transform = self.view['ball'].pose