Jump to content

Where is the "mouse position"?


Dizzy
 Share

Recommended Posts

READ THE HELP FILE! It is in there.

From the help file:

MouseGetPos

--------------------------------------------------------------------------------

Retrieves the current position of the mouse cursor.

MouseGetPos ( [dimension])

Parameters

Dimension An optional argument that determines what the return value will be. See Return Value.

Return Value

Dimension Values

None Returns a two-element array that containing the mouse coordinates: $array[0] = X coord (horizontal), $array[1] = Y coord (vertical)

0 Returns the X co-ordinate as an integer.

1 Returns the Y co-ordinate as an integer.

If dimension is not a number @error will be set to 1.

Remarks

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

Related

MouseClick, MouseClickDrag, MouseMove, MouseCoordMode (Option)

Example

$pos = MouseGetPos()

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

Link to comment
Share on other sites

  • Moderators

What version of AutoInfo are you using? (that looks ancient :lmao: ).

Class: SciTEWindow

Size: X: -4 Y: -4 W: 1288 H: 902

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Client: X: 981 Y: 179

Cursor ID: 5

Under Mouse Details, it can be changed in Options, Change Coord Mode, 3 settings (Screen/Window/Client).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Or you might want to take the time to make your own set of little tools like this one:

AutoItSetOption("MouseCoordMode", 1)
;Use Mouse Coordinates relative to:
;1-rel to desktop
AutoItSetOption("TrayIconDebug", 1)

HotKeySet("{PAUSE}", "Terminate")

While 1
    $pos = MouseGetPos()
    ToolTip("Desktop X: " & $pos[0] & ", " & "Desktop Y: " & $pos[1] & " Pause2exit")
    Sleep(10)
WEnd

Func Terminate()
    ClipPut('MouseClick("left",' & $pos[0] & ',' & $pos[1] & ',1,1) ; wrt DESKTOP')
    Exit
EndFunc   ;==>Terminate
Start the script.

Place the mouse over the location of interest.

End the script via the hotkey.

Paste the contents of the Windows clipboard into your script.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • 2 weeks later...

I also read the help file & its totally not helpful at all! until i finally managed find that hidden option in the newest autiolt window info ! this done & all good(I found the window mouse coords i want to set) but the mouse wont move to the currently active window position Iset...& thats depressing, because there is no examples how to use it nowhere :lmao:

Now look at this, Why isnt it working? any ideas?

HotKeySet("!{numpad9}", "NO_monitor_Opera")

Func NO_monitor_Opera()                 ; Dont monitor opera function begins
    Run("IDMan.exe", "", @SW_MAXIMIZE)              ;Opens ID-MAN ", "", maximise the window
    sleep(600)
    MouseMove(91, 31, 10)
EndFunc
Edited by chie
Link to comment
Share on other sites

The helpfile is one of the most easy to understand of any language I've seen. No offense but i think my neice would be able to read and understand what the functions in it do...

[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...