Difference between revisions of "ISKernel:mouse (Object Type)"
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
== Methods == | == Methods == | ||
− | |||
− | |||
* '''LeftClick''': Presses and immediately releases the left mouse button | * '''LeftClick''': Presses and immediately releases the left mouse button | ||
* '''RightClick''': Presses and immediately releases the right mouse button | * '''RightClick''': Presses and immediately releases the right mouse button | ||
Line 21: | Line 19: | ||
== Examples == | == Examples == | ||
+ | ===Display active system for mouse input=== | ||
+ | *echo Current mouse input: ${Mouse.System} | ||
+ | ;Output | ||
+ | Current mouse input: Win32I | ||
+ | ===Display mouse pointers position=== | ||
+ | *echo Mouse Pos: ${Mouse} | ||
+ | ;Output | ||
+ | Mouse Pos: 378,607 | ||
+ | ===Click the left mouse button=== | ||
+ | *Mouse:LeftClick | ||
+ | :Clicks the left mouse button | ||
+ | ===Click the right mouse button=== | ||
+ | *Mouse:RightClick | ||
+ | :Clicks the right mouse button | ||
+ | ===Click and hold the left mouse button=== | ||
+ | *Mouse:HoldLeft | ||
+ | :Clicks and holds down the left mouse button | ||
+ | ===Release the left mouse button=== | ||
+ | *Mouse:ReleaseLeft | ||
+ | :Releases the left mouse button | ||
+ | ===Sets the mouse position to a given X,Y=== | ||
+ | *Mouse:SetPosition[250,500] | ||
+ | :Will move mouse pointer to the pixel at 250,500 | ||
+ | |||
+ | ;Sample | ||
+ | |||
+ | do | ||
+ | { | ||
+ | Mouse:SetPosition[275,437] | ||
+ | Mouse:LeftClick | ||
+ | Mouse:LeftClick | ||
+ | wait 5 | ||
+ | Mouse:SetPosition[453,437] | ||
+ | Mouse:LeftClick | ||
+ | Mouse:LeftClick | ||
+ | wait 5 | ||
+ | } | ||
+ | while (1) | ||
== See Also == | == See Also == | ||
* [[LavishScript:Data Types|LavishScript Data Types]] | * [[LavishScript:Data Types|LavishScript Data Types]] | ||
− | * [[IS:Session#Data_Types|Inner Space Session Data Types]] | + | * [[IS:Session#Data_Types|Inner Space Session Data Types]] |
{{DT-Stub}} | {{DT-Stub}} |
Revision as of 00:56, 27 August 2005
Description
Members
- string System: Name of the currently active system for mouse input (DirectInput, Win32I)
- int X: Current mouse X position (horizontal)
- int Y: Current mouse Y position (vertical)
Methods
- LeftClick: Presses and immediately releases the left mouse button
- RightClick: Presses and immediately releases the right mouse button
- HoldLeft: Presses and holds the left mouse button
- ReleaseLeft: Releases the left mouse button
- HoldRight: Presses and holds the right mouse button
- ReleaseRight: Releases the right mouse button
- SetPosition[x,y]: Sets the mouse position
Returns
Position of the mouse, in the form X,Y, such as 0,0 or 263,475
Examples
Display active system for mouse input
- echo Current mouse input: ${Mouse.System}
- Output
Current mouse input: Win32I
Display mouse pointers position
- echo Mouse Pos: ${Mouse}
- Output
Mouse Pos: 378,607
Click the left mouse button
- Mouse:LeftClick
- Clicks the left mouse button
Click the right mouse button
- Mouse:RightClick
- Clicks the right mouse button
Click and hold the left mouse button
- Mouse:HoldLeft
- Clicks and holds down the left mouse button
Release the left mouse button
- Mouse:ReleaseLeft
- Releases the left mouse button
Sets the mouse position to a given X,Y
- Mouse:SetPosition[250,500]
- Will move mouse pointer to the pixel at 250,500
- Sample
do { Mouse:SetPosition[275,437] Mouse:LeftClick Mouse:LeftClick wait 5 Mouse:SetPosition[453,437] Mouse:LeftClick Mouse:LeftClick wait 5 } while (1)