drag mouse to left by 50 pixels with no discernible reference point

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
milkygirl90
Posts: 565
Joined: 10 Nov 2020, 21:22

drag mouse to left by 50 pixels with no discernible reference point

23 Jul 2021, 23:30

Using this image as reference, the numbers are variable (sometimes it can be in 4000s range, sometimes it can be 20, 25, 30). Depending on where the cursor is, the gray bubble position can also change.

My goal is to place my cursor in the middle of ANY two numbers, and drag left by 50 pixels.

How can I do this?

Image

I also want to know how to leave the parameters blank with the above scenario since it's just a simple x axis move, but the one below doesn't work:

Code: Select all

MouseClickDrag, L,,, 150,,
User avatar
boiler
Posts: 16900
Joined: 21 Dec 2014, 02:44

Re: drag mouse to left by 50 pixels with no discernible reference point

24 Jul 2021, 10:15

You are skipping parameters that are not optional, and you are not specifying relative movement. When reading the documentation for a command or function, only the parameters enclosed in [ ] are optional. It also seems you are trying to drag 150 pixels to the right instead of 50 pixels to the left like you stated. Here is how you drag 50 pixels to the left:

Code: Select all

MouseClickDrag, L, 0, 0, -50, 0,, R

What the above does is drag from a point 0,0 to a point -50,0 in a relative fashion. As an alternative that accomplishes the same thing (dragging 50 pixels to the left in a relative fashion):

Code: Select all

MouseClickDrag, L, 50, 0, 0, 0,, R
In this case, it drags from a point 50,0 to 0,0 in a relative fashion, which also is 50 pixels to the left.

I haven’t tested it, so perhaps leaving a coordinate parameter blank is the same as specifying 0 for this command, but you should get into the habit of always putting something in a parameter that is not optional.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 230 guests