Difference between revisions of "Mouse Control"

From SolarStrike wiki
Jump to: navigation, search
(mousetSet(x,y))
Line 3: Line 3:
 
Sets the mouse's screen position to (x,y), where x and y are integers. Coordinates are absolute. See mouseMove() to specify relative coordinates.
 
Sets the mouse's screen position to (x,y), where x and y are integers. Coordinates are absolute. See mouseMove() to specify relative coordinates.
  
 +
 +
'''Example'''
 +
<source lang="lua">
 +
mouseSet(100, 200); -- This will move the mouse to (100,200)
 +
</source>
  
 
== mouseMove(x,y) ==
 
== mouseMove(x,y) ==

Revision as of 10:22, 13 July 2008

mousetSet(x,y)

Sets the mouse's screen position to (x,y), where x and y are integers. Coordinates are absolute. See mouseMove() to specify relative coordinates.


Example

mouseSet(100, 200); -- This will move the mouse to (100,200)

mouseMove(x,y)

Moves the mouse (x,y) pixels, where x and y are integers. Coordinates are relative. See mouseSet to specify absolute coordinates.


mouseLClick()

Clicks the left mouse button.


mouseMClick()

Clicks the middle (or wheel) mouse button.


mouseRClick()

Clicks the right mouse button.


mouseLHold()

Holds down the left mouse button until a left click or left release. Use mouseLRelease() to release.


mouseMHold()

Holds down the middle/wheel mouse button until a middle/wheel click or middle/wheel button release. Use mouseMRelease() to release.


mouseRHold()

Holds down the right mouse button until a right click or right release. Use mouseRRelease() to release.


mouseLRelease()

Releases the left mouse button, if held down.


mouseMRelease()

Releases the middle/wheel mouse button, if held down.


mouseRRelease()

Releases the right mouse button, if held down.


mouseWheelMove()

Move the mouse wheel up or down by 'amount'. 'amount' can be either positive (up) or negative (down). An 'amount' of 100 is roughly one 'tick' of the wheel.


x,y mouseGetPos()

Retrieve the screen coordinates of the mouse. Returns two integers: x and y.


mouseSetDelay

Similar to keyboardSetDelay(), this function sets the delay (in miliseconds) between click and release for functions like mouseLClick() and mouseRClick().