====== 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 ===
* ([[en:code:core:point|Point]]) the current position of the cursor
==== move ====
Moves the mouse cursor.
=== Syntax ===
myObject.move(position);
=== Arguments ===
- position - ([[en:code:core:point|Point]]) the position where to move the mouse cursor
=== Returns ===
* (Mouse) this Mouse
==== isButtonPressed ====
Returns true if **button** is pressed.
=== Syntax ===
myObject.isButtonPressed(button);
=== Arguments ===
- button - ([[#button|Button]]) the button to check
=== Returns ===
* (boolean) true if **button** is pressed
==== press ====
Presses a mouse button or the left button if no button is specified.
=== Syntax ===
myObject.press(button);
myObject.press();
=== Arguments ===
- button - ([[#button|Button]]) the button to press
=== Returns ===
* (Mouse) this Mouse
=== Exceptions ===
* (PressButtonError) unable to press the button
==== release ====
Releases a mouse button or the left button if no button is specified.
=== Syntax ===
myObject.release(button);
myObject.release();
=== Arguments ===
- button - ([[#button|Button]]) the button to release
=== Returns ===
* (Mouse) this Mouse
=== Exceptions ===
* (ReleaseButtonError) unable to release the button
==== click ====
Presses and releases a mouse button or the left button if no button is specified.
=== Syntax ===
myObject.click(button);
myObject.click();
=== Arguments ===
- button - ([[#button|Button]]) the button to press and release
=== Returns ===
* (Mouse) this Mouse
=== Exceptions ===
* (ClickError) unable to press and release the button
==== wheel ====
Emulates a mouse wheel movement.
=== Syntax ===
myObject.wheel(intensity);
myObject.wheel();
=== Arguments ===
- intensity - (integer) the wheel movement intensity, positive is forward, negative is backward (default: 1)
=== Returns ===
* (Mouse) this Mouse
=== Exceptions ===
* (WheelError) unable to emulate a mouse wheel
===== Enumerations =====
==== Button ====
Mouse buttons.
=== Values ===
- LeftButton: left button
- MiddleButton: middle button
- RightButton: right button