Jump to content

*Updated* Mouse coordinates


XxSunxX
 Share

Recommended Posts

Allo. Can anyone help me with a script that tells me my mouse coordinates. I would like something that as I move my mouse it shows my current mouse coordinates. I would like it to be either two ways.

- A box appears at my mouse cursor and as I move my cursor text in the box has something like x=? y=?

- Text in a GUI changes as I move my cursor telling me my coordinates.

I would like choice two the most.

Could someone please help me out?

Thanks. :whistle:

Link to comment
Share on other sites

Here is something to get you started.

; This will create a tooltip in the upper left of the screen

HotKeySet("{ESC}","TheEnd")

While 1
    $pos = MouseGetPos()
    ToolTip("x = " & $pos[0] & " y = " & $pos[1], $pos[0]+5, $pos[1]+5)
    Sleep(100)  ; Sleep to give tooltip time to display
WEnd
    
Func TheEnd()
    Exit
EndFunc

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

dam my comp went dumb and dev beat me to it but here's what i did :whistle:

Dim $Mouse
HotKeySet("{F5}", "_Terminate")

While 1
    $Mouse = MouseGetPos()
    TrayTip("", "X: "& $Mouse[0] & "  Y: "& $Mouse[1], 0)
    ;or you could do
    ;ToolTip("X: "& $Mouse[0] &"  Y: "& $Mouse[1], $Mouse[0] + 10, $Mouse[1] + 10)
    Sleep(20)
WEnd

Func _Terminate()
    Exit
EndFunc ;==> _Terminate()
Link to comment
Share on other sites

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("MCF Requested Version", 148, 50, 469, 469, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
GUISetBkColor(0x335EA8)
$Button1 = GUICtrlCreateButton("Start", 0, 0, 147, 25, 0)
$Button2 = GUICtrlCreateButton("Stop", 0, 24, 147, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $Button2
        Exit
        Case $Button1
        While 1
    $pos = MouseGetPos()
    ToolTip("x = " & $pos[0] & " y = " & $pos[1], $pos[0]+5, $pos[1]+5)
WEnd
    Case $Button2
        Exit
Func TheEnd()
    Exit
EndFunc
            Exit

    EndSwitch
WEnd

When I click start it does what I want, but when I click stop it doesnt stop. Help please. :whistle:

Link to comment
Share on other sites

When I click start it does what I want, but when I click stop it doesnt stop. Help please. :whistle:

You are sure you don't get syntax errors when you run that script????

Try this:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("MCF Requested Version", 148, 50, 469, 469, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE))
GUISetBkColor(0x335EA8)
$Button1 = GUICtrlCreateButton("Start", 0, 0, 147, 25, 0)
$Button2 = GUICtrlCreateButton("Stop", 0, 24, 147, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button2
            AdlibDisable()
            ToolTip("")
            
        Case $Button1
            AdlibEnable("_ShowMousePos",150)
    EndSwitch
WEnd

Func _ShowMousePos()
    $pos = MouseGetPos()
    ToolTip("x = " & $pos[0] & " y = " & $pos[1], $pos[0] + 5, $pos[1] + 5)
EndFunc

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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...