Strange MouseClick behavior Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Oblomov228
Posts: 51
Joined: 15 Feb 2020, 16:41

Strange MouseClick behavior

15 Feb 2020, 17:14

In

Code: Select all

f4::
MouseClick, left, 1265, 758
I'm trying to assign a click to F4

as explained in:
https://www.autohotkey.com/docs/commands/MouseClick.htm

However, the mouse clicks way off and not consistently either. Where it basically moves to the right every next click...

I used a program called FastKeys to record the needed area, however, it's kind of strange that upon execution, the mouse clicks in different directions, rather than just one
User avatar
Oblomov228
Posts: 51
Joined: 15 Feb 2020, 16:41

Re: Strange MouseClick behavior

16 Feb 2020, 02:51

Thanks for the reply!

I tried

f4::
CoordMode "Mouse", "Screen"
MouseClick, left, 1265, 758

However, it didn't quite seem to help
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Strange MouseClick behavior

16 Feb 2020, 04:00

Code: Select all

CoordMode, Mouse, Screen
f4::
  MouseClick, left, 1265, 758
Return
User avatar
Oblomov228
Posts: 51
Joined: 15 Feb 2020, 16:41

Re: Strange MouseClick behavior

16 Feb 2020, 08:48

HotKeyIt wrote:
16 Feb 2020, 04:00

Code: Select all

CoordMode, Mouse, Screen
f4::
  MouseClick, left, 1265, 758
Return
Thanks for the follow-up! However, the behavior still appears to be the same (did reload the script). Kind of really amazing that performing a mere click, is so darn difficult through AutoHotkey :(
gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: Strange MouseClick behavior  Topic is solved

16 Feb 2020, 08:59

Like in every programming language, you need to use the right syntax.

The CoordMode, Mouse, Screen needs to be reachable, that means at the top of the script, in the auto-execute section.
That means, if you have, for example, other hotkeys above that line, it won't work. Put it at the top...
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: Strange MouseClick behavior

16 Feb 2020, 09:00

Works fine for me, it always clicks at the coordinates.
Make also sure the old script was closed.

Edit: thanks @gregster , did not think about that.
User avatar
Oblomov228
Posts: 51
Joined: 15 Feb 2020, 16:41

Re: Strange MouseClick behavior

16 Feb 2020, 09:29

gregster wrote:
16 Feb 2020, 08:59
Like in every programming language, you need to use the right syntax.

The CoordMode, Mouse, Screen needs to be reachable, that means at the top of the script, in the auto-execute section.
That means, if you have, for example, other hotkeys above that line, it won't work. Put it at the top...
Oh nice! This solved it! Thanks a lot 👍

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Spawnova and 285 guests