Skip to main content
Desktop

Mouse

Mouse

The Mouse module is responsible for performing every mouse action on the user's computer.

js
await Mouse.click["v2_0_0"]({})
Additional information

The mouse module uses the concept of coordinates to perform its actions. See how to use the coordinates.

Methods

click

Method responsible for performing a mouse click at a given position or at the current position of the pointer.

js
await Mouse.click["v2_0_0"]({})

Required parameters

This method has no required parameters.

Information

If no parameter is passed, the method clicks at the current position of the pointer.

Optional parameters

  • button: String - mouse button to be used. Default value: left. Values: left | right.
  • x: Integer - x position of the mouse on the screen.
  • y: Integer - y position of the mouse on the screen.

Return

This method has no return.

doubleClick

Method responsible for performing a mouse double click at the current position of the pointer.

js
await Mouse.doubleClick["v1_0_0"]({
button: 'left'
})

Required parameters

This method has no required parameters.

Optional parameters

  • button: String - mouse button to be used. Default value: left. Values: left | right.

Return

This method has no return.

dragAndDrop

Method responsible for performing a drag and drop action with the mouse.

js
await Mouse.dragAndDrop["v2_0_0"]({
initialX: 0,
initialY: 0,
finalX: 1920,
finalY: 1080,
})

Required parameters

  • initialX: Integer - initial x position of the drag.
  • initialY: Integer - initial y position of the drag.
  • finalX: Integer - final x position of the drop.
  • finalY: Integer - final y position of the drop.

Optional parameters

  • button: String - mouse button to be used. Default value: left. Values: left | right.

Return

This method has no return.

move

Method responsible for moving the mouse pointer to an absolute position on the screen.

js
await Mouse.move["v2_0_0"]({
x: 500,
y: 400,
})

Required parameters

This method has no required parameters.

Optional parameters

  • x: Integer - x position the pointer will be moved to. Default value: 0.
  • y: Integer - y position the pointer will be moved to. Default value: 0.

Return

This method has no return.

moveRelative

Method responsible for moving the mouse pointer from its current position, using a relative displacement.

js
await Mouse.moveRelative["v2_0_0"]({
x: 100,
y: 50,
directionX: "right",
directionY: "down"
})

Required parameters

This method has no required parameters.

Optional parameters

  • x: Integer - number of pixels to displace horizontally. Default value: 0.
  • y: Integer - number of pixels to displace vertically. Default value: 0.
  • directionX: String - horizontal direction. Default value: right. Values: left | right.
  • directionY: String - vertical direction. Default value: down. Values: up | down.

Return

This method has no return.

scroll

Method responsible for performing the vertical scroll movement of the mouse.

js
await Mouse.scroll["v2_0_0"]({
vertical: 300,
directionV: "down"
})

Required parameters

This method has no required parameters.

Optional parameters

  • vertical: Integer - number of pixels to scroll. Default value: 0.
  • directionV: String - scroll direction. Default value: down. Values: up | down.

Return

This method has no return.