MouseMove to absolute coordinates not working

Report problems with documented functionality
User avatar
JoeWinograd
Posts: 1203
Joined: 10 Feb 2014, 20:00

MouseMove to absolute coordinates not working

20 Feb 2019, 14:50

W7 Pro 64-bit
AHK 1.1.30.01 U32

I'm running a source script (i.e., not compiled) by double-clicking the AHK file in my file manager (Total Commander). Here's the script:

Code: Select all

Sleep 2000 ; to make sure mouse hasn't moved after double-click
MouseMove,100,100
Since I don't have Relative specified as the fourth param, the X and Y coordinates should be treated as absolute values. They are not. The mouse moves to 100,100 relative to my file manager instead of absolute to the screen. Regards, Joe
Helgef
Posts: 3704
Joined: 17 Jul 2016, 01:02
Contact:

Re: MouseMove to absolute coordinates not working

20 Feb 2019, 15:01

This is documented behaviour,
Coordinates are relative to the active window unless CoordMode was used to change that.
Cheers.
gregster
Posts: 2397
Joined: 30 Sep 2013, 06:48

Re: MouseMove to absolute coordinates not working

20 Feb 2019, 15:02

I think this is a misunderstanding.
JoeWinograd wrote:
20 Feb 2019, 14:50
Since I don't have Relative specified as the fourth param, the X and Y coordinates should be treated as absolute values. They are not. The mouse moves to 100,100 relative to my file manager instead of absolute to the screen. Regards, Joe
You probably overlooked this:
X, Y

The x/y coordinates to move the mouse to, which can be expressions. Coordinates are relative to the active window unless CoordMode was used to change that.
This has nothing to do with the Relative parameter. In your case, the coords are still "treated as absolute values" - but relative to the active window (but this means, absolute window coords). The Relative option would only mean relative to the current mouse position ("as offsets from the current mouse position").
User avatar
JoeWinograd
Posts: 1203
Joined: 10 Feb 2014, 20:00

Re: MouseMove to absolute coordinates not working

20 Feb 2019, 15:14

Ah, my bad! Thanks to both of you. It is, indeed, documented, and it is, indeed, a misunderstanding of Relative and Absolute on my part. Much appreciated, folks! Regards, Joe

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 8 guests