I would like to have a hotkey, which shows a transparent circle around the current mouse position.
Works fine, but not, if the mouse is near the left side of the screen.
Reason is a negative value in x of the x-y parm.
Could that be changed or has anyone another idea how to do it?
Thanks
Code:
#SingleInstance force
Gosub ShowMouseCircle
Return
^n::
ExitApp
ShowMouseCircle:
^m::
titleSlct = circle
CoordMode, Mouse, Screen
MouseGetPos, mx, my,
Gui, 12:Color, Red
Gui, 12:Show, x50 y50 w1 h1 Noactivate, %titleSlct%
WinSet, Transparent, 45, %titleSlct%
Gui, 12: +AlwaysOnTop
mw = 300
mx -= 150
my -= 150
dx = 50
dy = 50
Gui, 12:-Caption
WinSet, Region, %mx%-%my% W%mw% H%mw% E, %titleSlct%
Gui, 12:Show, x0 y0 w%A_ScreenWidth% h%A_ScreenHeight% Noactivate, %titleSlct%
;Loop to show the problem:
Loop 30
{
Sleep 222
mx -= %dx%
if (my < -300)
dy *= -1
my -= %dy%
WinSet, Region, %mx%-%my% W%mw% H%mw% E, %titleSlct%
if ErrorLevel
Tooltip Fehler (mx is negative) `nx: %mx% `ny:%my%
else
Tooltip x: %mx% `ny:%my%
}
Gui, 12:Destroy
Tooltip
Return