^+j::
; MouseClickDrag, Left, 825,392,739,511 , 100
; MouseClickDrag, Left, 739,511,825,630 , 100
; MouseClickDrag, Left, 825,630,965,584 , 100
; MouseClickDrag, Left, 965,584,965,438 , 100
; MouseClickDrag, Left, 965,438,825,392 , 100
; Return
; MouseClickDrag, Left, 989,511,903,392, 100
; MouseClickDrag, Left, 903,392,763,438, 100
; MouseClickDrag, Left, 763,438,763,584, 100
; MouseClickDrag, Left, 763,584,903,630, 100
; MouseClickDrag, Left, 903,630,989,511, 100
; Return
send, {click left Down}
MouseMove, -75, +230, 100, R
MouseMove, +196, +142, 100, R
MouseMove, +196, -142, 100, R
MouseMove, -75, -230, 100, R
MouseMove, -242, 0, 100, R
send, {click left Up}
Return
This is supposed to draw a pentagon. More or less. The question is why does it do this? (see picture attached)
Same thing happened when I tried the above codes but it is flipped which was intended.
Can somebody explain this to me or help me fix the issue, pretty please?
Weird Mouse Movements
-
- Posts: 3
- Joined: 17 Jan 2019, 17:19
Weird Mouse Movements
- Attachments
-
- autohotkey-pEnTaGoN.PNG (13.49 KiB) Viewed 1725 times
Re: Weird Mouse Movements
Can confirm, looks like a bug.
The work around is setting all speeds to 0.
Indirectly related your script would benefit from having
Before starting to click. Because drawing tools can understand Ctrl, as wanting a orthogonal lines, etc.
I tried that fix but it wasn't the problem.
The work around is setting all speeds to 0.
Indirectly related your script would benefit from having
Code: Select all
KeyWait, Ctrl
KeyWait, Shift
KeyWait, j
I tried that fix but it wasn't the problem.
Re: Weird Mouse Movements
It only made one line for me. But adding a Sleep , 50 between each MouseMove made it work just fine. (I did not include KeyWait.)
Re: Weird Mouse Movements
The sleeps don't fix anything for me. (Win 10 x64, Ahk 1.1.30.01 x64)
Re: Weird Mouse Movements
I am using the same version on Win10 x64. Hmm, have you tried increasing the sleep to something longer, like 250? Maybe it comes down hardware?
Re: Weird Mouse Movements
I don't know what it is but...
It's not about the relative positioning because this also fails:
It's not about the relative positioning because this also fails:
Code: Select all
^+g::
KeyWait, Ctrl
KeyWait, Shift
KeyWait, g
X := 200
Y := 200
MouseMove, % X, % Y, 100
send, {click left Down}
MouseMove, % X+=-75, % Y+=+230, 100
MouseMove, % X+=+196, % Y+=+142, 100
MouseMove, % X+=+196, % Y+=-142, 100
MouseMove, % X+=-75, % Y+=-230, 100
MouseMove, % X+=-242, % Y+=0, 100
send, {click left Up}
Return
Re: Weird Mouse Movements
It appears to be related to the speed. Black was at 100, red was at 50, green was at 25, there is a blue that is hard to see - but it was at 5, pink was at 0. I think the reason I was getting different results initially is that I had SendMode , Input at the top of my script, which is essentially the same as speed 0.
-
- Posts: 3
- Joined: 17 Jan 2019, 17:19
Re: Weird Mouse Movements
Thank you everyone for they reply!