AutoIt MouseGetPos Function

Reference on the AutoIt MouseGetPos Function, list of allowed Parameters, and useful example.

The AutoIt MouseGetPos Function returns the current position of the mouse pointer. The returned value can either be the X and Y position, X alone or Y alone.

The MouseCoordMode Option controls whether the absolute or relative position is returned. Default is Absolute.

Parameters

This Function takes 1 optional parameter, which controls the value that should be returned.

NoneIf no parameter was provided, a 2 element array will be returned containing the x and y positions.
0Returns the (x) left position of the pointer.
1Returns the (y) top position of the pointer.

AutoIt MouseGetPos Example

$pos = MouseGetPos()
MsgBox(0, "Mouse (x) left, (y) top:", $pos[0] & "," & $pos[1])

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.