Skip to content

Instantly share code, notes, and snippets.

@wi1k1n
Last active April 19, 2024 16:16
Show Gist options
  • Save wi1k1n/93d5f266f8f050a4af61fea780cbb9e8 to your computer and use it in GitHub Desktop.
Save wi1k1n/93d5f266f8f050a4af61fea780cbb9e8 to your computer and use it in GitHub Desktop.
AutoHotKey: Mouse Position Helper. Simply run the script and it will show the current cursor coordinates in different CoordModes. Hotkey Strokes are also available to quickly copy current coordinates
#Persistent
CoordMode, ToolTip, screen
SetTimer, WatchCursor, 100
return
WatchCursor:
CoordMode, mouse, Screen ; Coordinates are relative to the desktop (entire screen).
MouseGetPos, x_1, y_1, id_1, control_1
CoordMode, mouse, Window ; Synonymous with Relative and recommended for clarity.
MouseGetPos, x_2, y_2, id_2, control_2
CoordMode, mouse, Client ; Coordinates are relative to the active window's client area
MouseGetPos, x_3, y_3, id_3, control_3
ToolTip, Screen: `t`tx %x_1% y %y_1%`t(Ctrl+Shift+S)`nWindow: `t`tx %x_2% y %y_2%`t(Ctrl+Shift+W)`nClient: `t`tx %x_3% y %y_3%`t(Ctrl+Shift+C)`n`t(Ctrl+Esc) to exit, % A_ScreenWidth-200, % A_ScreenHeight-200
return
^+S::
Clipboard := x_1 "; " y_1
return
^+W::
Clipboard := x_2 "; " y_2
return
^+C::
Clipboard := x_3 "; " y_3
return
^Escape::
ExitApp
Return
@gignupg
Copy link

gignupg commented Feb 1, 2024

Thx a lot, works like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment