Table of Contents

Mouse

This object allows you to simulate mouse actions.

Functions

Mouse

Constructor function.

Syntax

var myObject = new Mouse();

Methods

position

Returns the current position of the cursor.

Syntax

myObject.position();

Returns

move

Moves the mouse cursor.

Syntax

myObject.move(position);

Arguments

  1. position - (Point) the position where to move the mouse cursor

Returns

isButtonPressed

Returns true if button is pressed.

Syntax

myObject.isButtonPressed(button);

Arguments

  1. button - (Button) the button to check

Returns

press

Presses a mouse button or the left button if no button is specified.

Syntax

myObject.press(button);
myObject.press();

Arguments

  1. button - (Button) the button to press

Returns

Exceptions

release

Releases a mouse button or the left button if no button is specified.

Syntax

myObject.release(button);
myObject.release();

Arguments

  1. button - (Button) the button to release

Returns

Exceptions

click

Presses and releases a mouse button or the left button if no button is specified.

Syntax

myObject.click(button);
myObject.click();

Arguments

  1. button - (Button) the button to press and release

Returns

Exceptions

wheel

Emulates a mouse wheel movement.

Syntax

myObject.wheel(intensity);
myObject.wheel();

Arguments

  1. intensity - (integer) the wheel movement intensity, positive is forward, negative is backward (default: 1)

Returns

Exceptions

Enumerations

Button

Mouse buttons.

Values

  1. LeftButton: left button
  2. MiddleButton: middle button
  3. RightButton: right button