AutoHotkey Community

It is currently May 27th, 2012, 12:46 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: September 7th, 2005, 6:48 pm 
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


Report this post
Top
  
Reply with quote  
PostPosted: September 8th, 2005, 3:22 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
specialGuest wrote:
Reason is a negative value in x of the x-y parm.
You may have already tried this, but I'd recommend calculating the X/Y for the region before setting the region. That way, you can make any negative numbers into zeros before setting the region.

I've clarified the documentation to indicate that negative coordinates may cause failure, in which case ErrorLevel is set to 1.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 8th, 2005, 10:44 am 
Chris wrote:
You may have already tried this,


Yes, I tried, but I got the expected result: the circle is not drawn around the actual mouse position, but on the left side of the screen.

Chris wrote:
I've clarified the documentation ....


Thanks. BTW - I never used any software (and I have tried a lot) with such an excellent documentation!
I imagine, this is one reason, why this forum has only thousand members - millions and millions of users all over the world are seemingly able to learn everything they need, just looking into your documentation.

Back to my problem:
As it works fine with a negtive y-value, I hope that in some future version you will find the time, to split up the x-y parm into 2 seperate values or to change the x-y-valuestring 100--100- to (100-)-(100-).


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2005, 4:07 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I should have paid more attention to your first post; I was blinded by the conviction that the region API in the OS doesn't accept negative coordinates, which is untrue.

Instead this was caused by a bug in the program that prevented acceptance of negative X coordinates, which has been fixed. If after upgrading to v1.0.38.02 there are any remaining problems, please let me know.

Thanks for persisting.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 33 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group