Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Getting Exact Mouse Position on the Screen


  • Please log in to reply
2 replies to this topic
FunnyO
  • Members
  • 61 posts
  • Last active: Aug 03 2015 05:06 PM
  • Joined: 04 Apr 2015

Hello,

 

As im still new to this Scripting language, id like to have a script, thats giving me the exact Mouse Position on the Screen. It shall be displayed as overlay at the bottom right corner.

 

Because im doing many macros, that ease my day, id love to have this.

 

Thank you very much!

 

If there already is such a Topic, please redirect me, because i didnt find any.



Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
#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%`nWindow :`tx %x_2% y %y_2%`nClient :`t`tx %x_3% y %y_3%, % A_ScreenWidth-200, % A_ScreenHeight-200
return

Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

Guest10
  • Members
  • 1216 posts
  • Last active: Oct 30 2015 05:12 PM
  • Joined: 27 Oct 2012

WOW! This is great! :D

#SingleInstance Force
#NoEnv
#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%`tY: %Y_1%`nWindow:`tX: %X_2%`tY: %Y_2%`nClient:`t`tX: %X_3%`tY: %Y_3%, % A_ScreenWidth-

200, % A_ScreenHeight-200
Return

Esc::ExitApp