code:device:mouse
Differences
This shows you the differences between two versions of the page.
code:device:mouse [2011/01/26 20:46] – created jmgr | code:device:mouse [2011/04/20 20:29] (current) – removed jmgr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Mouse ====== | ||
- | This object allows you to simulate mouse actions. | ||
- | ===== Functions ===== | ||
- | |||
- | ==== Mouse ==== | ||
- | Constructor function. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | var myObject = new Mouse(); | ||
- | </ | ||
- | |||
- | ===== Methods ===== | ||
- | |||
- | ==== position ==== | ||
- | Returns the current position of the cursor. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.position(); | ||
- | </ | ||
- | |||
- | === Returns === | ||
- | * ([[code: | ||
- | |||
- | ==== move ==== | ||
- | Moves the mouse cursor. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.move(position); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - position - ([[code: | ||
- | |||
- | === Returns === | ||
- | * (Mouse) this Mouse | ||
- | |||
- | ==== isButtonPressed ==== | ||
- | Returns true if **button** is pressed. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.isButtonPressed(button); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - button - ([[# | ||
- | |||
- | === Returns === | ||
- | * (boolean) true if **button** is pressed | ||
- | |||
- | ==== press ==== | ||
- | Presses a mouse button or the left button if no button is specified. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.press(button); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.press(); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - button - ([[# | ||
- | |||
- | === 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 === | ||
- | <code javascript> | ||
- | myObject.release(button); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.release(); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - button - ([[# | ||
- | |||
- | === 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 === | ||
- | <code javascript> | ||
- | myObject.click(button); | ||
- | </ | ||
- | <code javascript> | ||
- | myObject.click(); | ||
- | </ | ||
- | |||
- | === Arguments === | ||
- | - button - ([[# | ||
- | |||
- | === Returns === | ||
- | * (Mouse) this Mouse | ||
- | |||
- | === Exceptions === | ||
- | * (ClickError) unable to press and release the button | ||
- | |||
- | ==== wheel ==== | ||
- | Emulates a mouse wheel movement. | ||
- | |||
- | === Syntax === | ||
- | <code javascript> | ||
- | myObject.wheel(intensity); | ||
- | </ | ||
- | <code javascript> | ||
- | 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: | ||
- | - RightButton: |
code/device/mouse.1296074816.txt.gz · Last modified: 2021/02/13 11:23 (external edit)