Core Function MouseGetPos

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
UberFoX (Talk | contribs)
(Created page with "<pre> MouseGetPos ( ) </pre> === Description === Retrieves the current position of the mouse cursor. === Parameters === None ==== clicks ==== Iptional; The number of times ...")
Newer edit →

Revision as of 12:19, 26 November 2011

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 . "'");
MouseWheel("up", 10);
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox