Core Function MouseGetPos

From Sputnik Wiki
Jump to: navigation, search
MouseGetPos ( )

Contents

Description

Retrieves the current position of the mouse cursor.

Parameters

None

clicks

Iptional; The number of times to move the wheel. Default is 1.

Return Value

Returns a two-element array that containing the mouse coordinates:

$array[0] = X coord (horizontal)

$array[1] = Y coord (vertical)

Remarks

See Opt(MouseCoordMode) for relative/absolute position settings. If relative positioning, numbers may be negative.

Example

$m = MouseGetPos();
println("X '$m[0]' Y '$m[1]'");
 
// OR
 
$m = MouseGetPos();
$x = $m[0];
$y = $m[1];
println("X '" . $x . "' Y '" . $y . "'");
 
// OR EVEN
 
$m = MouseGetPos();
$x = MouseGetPos()[0];
$y = MouseGetPos()[1];
println("X '" . $x . "' Y '" . $y . "'");
 
// OR OR
List ($x, $y) = MouseGetPos();
println("X '" . $x . "' Y '" . $y . "'");
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox