Weird Mouse Movements

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
domino1998gr
Posts: 3
Joined: 17 Jan 2019, 17:19

Weird Mouse Movements

17 Jan 2019, 17:35

^+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?
Attachments
autohotkey-pEnTaGoN.PNG
autohotkey-pEnTaGoN.PNG (13.49 KiB) Viewed 1725 times
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: Weird Mouse Movements

18 Jan 2019, 09:57

Can confirm, looks like a bug.

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
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.
eelrod
Posts: 65
Joined: 10 Apr 2018, 11:17

Re: Weird Mouse Movements

18 Jan 2019, 10:11

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.)
test.png
test.png (59.36 KiB) Viewed 1691 times
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: Weird Mouse Movements

18 Jan 2019, 10:24

The sleeps don't fix anything for me. (Win 10 x64, Ahk 1.1.30.01 x64)
eelrod
Posts: 65
Joined: 10 Apr 2018, 11:17

Re: Weird Mouse Movements

18 Jan 2019, 10:42

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?
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: Weird Mouse Movements

18 Jan 2019, 11:59

I don't know what it is but...
Image

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
eelrod
Posts: 65
Joined: 10 Apr 2018, 11:17

Re: Weird Mouse Movements

18 Jan 2019, 12:52

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.
test.png
test.png (17.12 KiB) Viewed 1646 times
domino1998gr
Posts: 3
Joined: 17 Jan 2019, 17:19

Re: Weird Mouse Movements

18 Jan 2019, 13:28

Thank you everyone for they reply!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: GEOVAN, jollyjoe, kashmirLZ, mikeyww and 239 guests