Mouse click and Hold to Pointer

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
nobitalk5
Posts: 1
Joined: 02 Feb 2023, 03:12

Mouse click and Hold to Pointer

Post by nobitalk5 » 02 Feb 2023, 03:27

Im newbie AHK AutoHotkey
Please help me in this case below:
Press "z" keyboard will take the following action
Mouse click and hold at position A(x = 155, y = 955) move to current pointer.

Code: Select all

z::
x :=155, y := 955
    alt := not alt
    if (alt)
    {
        Click %x%, %y%, down
    }
    else
    {
        Click up
    }
Return
Seems like the above code is not working as expected

It would be much appreciated if someone could help me on this.
Thanks in advance.

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Mouse click and Hold to Pointer

Post by boiler » 02 Feb 2023, 03:45

Are x and y relative to the active window or screen coordinates? See CoordMode.

“Not working as expected” isn’t giving us any insight into what the problem is. What does it actually do when you press the hotkey? Does it move the mouse pointer, but just not where you expected? Does it do nothing?

Post Reply

Return to “Ask for Help (v1)”