Mouse Drag from Left to Right Topic is solved

Ask gaming related questions (AHK v1.1 and older)
steevy
Posts: 11
Joined: 16 Dec 2020, 18:08

Mouse Drag from Left to Right

Post by steevy » 05 Jul 2022, 03:52

Hello,
I would like to drag my mouse cursor from Right of Left when I press a key and keep holding it until I let go the key.
This is what I tried but failed.

Code: Select all

\::
x1 := 1560, x2 := 1660, y := 656
Click, %x1%, %y%, down
Sleep, 1
MouseMove, x1, x2, 10
KeyWait, %A_ThisHotkey%
Click, up
MouseMove, x1, y
Return
I was able to drag my mouse cursor from bottom to top with the following but why I can not do it from right to left?
Please help me on this.
Thanks in advance!

Code: Select all

/::
x := 1664, y1 := 673, y2 := 723
Click, %x%, %y1%, down
Sleep, 1
MouseMove, x, y2, 10
KeyWait, %A_ThisHotkey%
Click, up
MouseMove, x, y1
Return
Last edited by BoBo on 05 Jul 2022, 04:26, edited 2 times in total.
Reason: Added [code][/code]-tags.

User avatar
mikeyww
Posts: 26944
Joined: 09 Sep 2014, 18:38

Re: Mouse Drag from Left to Right  Topic is solved

Post by mikeyww » 05 Jul 2022, 04:53

It worked here. You can examine the :arrow: KeyHistory.

steevy
Posts: 11
Joined: 16 Dec 2020, 18:08

Re: Mouse Drag from Left to Right

Post by steevy » 05 Jul 2022, 05:04

Thank you very much indeed.
It is working now.
Have a nice day!

Code: Select all

\::
x1 := 1560, x2 := 1660, y := 656
Click, %x1%, %y%, down
Sleep, 1
MouseMove, x1, x2, 10
KeyWait, %A_ThisHotkey%
Click, up
MouseMove, x1, y
Return

Post Reply

Return to “Gaming Help (v1)”