Difference between revisions of "Mouse Control"

From SolarStrike wiki
Jump to: navigation, search
Line 1: Line 1:
== mousetSet(x,y) ==
+
== mousetSet ==
 +
'''mouseSet(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.
 
Sets the mouse's screen position to (x,y), where x and y are integers. Coordinates are absolute. See mouseMove() to specify relative coordinates.
Line 10: Line 11:
  
  
== mouseMove(x,y) ==
+
== mouseMove ==
 +
'''mouseMove(x, y)'''
  
 
Moves the mouse (x,y) pixels, where x and y are integers. Coordinates are relative. See mouseSet to specify absolute coordinates.
 
Moves the mouse (x,y) pixels, where x and y are integers. Coordinates are relative. See mouseSet to specify absolute coordinates.
Line 21: Line 23:
  
  
== mouseLClick() ==
+
== mouseLClick ==
 +
'''mouseLClick()'''
  
 
Clicks the left mouse button.
 
Clicks the left mouse button.
Line 32: Line 35:
  
  
== mouseMClick() ==
+
== mouseMClick ==
 +
'''mouseMClick()'''
  
 
Clicks the middle (or wheel) mouse button.
 
Clicks the middle (or wheel) mouse button.
Line 43: Line 47:
  
  
== mouseRClick() ==
+
== mouseRClick ==
 +
'''mouseRClick()'''
  
 
Clicks the right mouse button.
 
Clicks the right mouse button.
Line 54: Line 59:
  
  
== mouseLHold() ==
+
== mouseLHold ==
 +
'''mouseLHold()'''
  
 
Holds down the left mouse button until a left click or left release. Use mouseLRelease() to release.
 
Holds down the left mouse button until a left click or left release. Use mouseLRelease() to release.
Line 65: Line 71:
  
  
== mouseMHold() ==
+
== mouseMHold ==
 +
'''mouseMHold()'''
  
 
Holds down the middle/wheel mouse button until a middle/wheel click or middle/wheel button release. Use mouseMRelease() to release.  
 
Holds down the middle/wheel mouse button until a middle/wheel click or middle/wheel button release. Use mouseMRelease() to release.  
Line 76: Line 83:
  
  
== mouseRHold() ==
+
== mouseRHold ==
 +
'''mouseRHold()'''
  
 
Holds down the right mouse button until a right click or right release. Use mouseRRelease() to release.
 
Holds down the right mouse button until a right click or right release. Use mouseRRelease() to release.
Line 87: Line 95:
  
  
== mouseLRelease() ==
+
== mouseLRelease ==
 +
'''mouseLRelease()'''
  
 
Releases the left mouse button, if held down.
 
Releases the left mouse button, if held down.
Line 98: Line 107:
  
  
== mouseMRelease() ==
+
== mouseMRelease ==
 +
'''mouseMRelease()'''
  
 
Releases the middle/wheel mouse button, if held down.
 
Releases the middle/wheel mouse button, if held down.
Line 109: Line 119:
  
  
== mouseRRelease() ==
+
== mouseRRelease ==
 +
'''mouseRRelease()'''
  
 
Releases the right mouse button, if held down.
 
Releases the right mouse button, if held down.
Line 120: Line 131:
  
  
== mouseWheelMove() ==
+
== mouseWheelMove ==
 +
'''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.
 
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.
Line 131: Line 143:
  
  
== x,y mouseGetPos() ==
+
== mouseGetPos ==
 +
'''x,y mouseGetPos()'''
  
 
Retrieve the screen coordinates of the mouse. Returns two integers: x and y.
 
Retrieve the screen coordinates of the mouse. Returns two integers: x and y.
Line 144: Line 157:
  
 
== mouseSetDelay ==
 
== mouseSetDelay ==
 +
'''mouseSetDelay()'''
  
 
Similar to keyboardSetDelay(), this function sets the delay (in miliseconds) between click and release for functions like mouseLClick() and mouseRClick().
 
Similar to keyboardSetDelay(), this function sets the delay (in miliseconds) between click and release for functions like mouseLClick() and mouseRClick().

Revision as of 10:44, 13 July 2008

mousetSet

mouseSet(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

mouseMove(x, y)

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


Example

mouseMove(5, 10); -- This will move the mouse right 5 pixels and down 10


mouseLClick

mouseLClick()

Clicks the left mouse button.


Example

mouseLClick(); -- The left mouse button will be clicked


mouseMClick

mouseMClick()

Clicks the middle (or wheel) mouse button.


Example

mouseMClick(); -- The middle/wheel mouse button will be clicked


mouseRClick

mouseRClick()

Clicks the right mouse button.


Example

mouseRClick(); -- The right mouse button will be clicked


mouseLHold

mouseLHold()

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


Example

mouseLHold(); -- The left mouse button will be held down. Click or use mouseLRelease to release


mouseMHold

mouseMHold()

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


Example

mouseLHold(); -- The middle/wheel mouse button will be held down. Click or use mouseMRelease to release


mouseRHold

mouseRHold()

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


Example

mouseRHold(); -- The right mouse button will be held down. Click or use mouseRRelease to release


mouseLRelease

mouseLRelease()

Releases the left mouse button, if held down.


Example

mouseLRelease(); -- The left mouse button is no longer being held


mouseMRelease

mouseMRelease()

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


Example

mouseRRelease(); -- The right mouse button is no longer being held


mouseRRelease

mouseRRelease()

Releases the right mouse button, if held down.


Example

mouseRRelease(); -- The right mouse button is no longer being held


mouseWheelMove

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.


Example

mouseWheelMove(100); -- The mouse wheel will be scrolled up 100 units.


mouseGetPos

x,y mouseGetPos()

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


Example

x,y = mouseGetPos();
printf("mouse_x: %d, mouse_y: %d", x, y); -- display the coordinates of the mouse


mouseSetDelay

mouseSetDelay()

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


Example

mouseSetDelay(100); -- The mouse delay is now 100ms