BlockInput MouseMove doesn't work while mouse button is held down

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
zebus
Posts: 2
Joined: 10 Aug 2022, 02:24

BlockInput MouseMove doesn't work while mouse button is held down

Post by zebus » 10 Aug 2022, 02:33

I guess maybe I've found a limitation of the function, but I have a section I want to not be interrupted by movement but it has parts where the mouse is held down for short amounts of time like so:

Code: Select all

MouseClick "left", xx+30, yy+30 "down", 1, 0, "down"
Sleep c
MouseClick "left", xx+30, yy+30 "down", 1, 0, "up"
And during those times the mouse can move like normal, sometimes messing up my script.

Does anyone know of a workaround for this?

Using v2


[Mod action: Moved to v2 section]

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

Re: BlockInput MouseMove doesn't work while mouse button is held down

Post by boiler » 10 Aug 2022, 05:55

Unrelated to your question, but why do you have "down" as part of your Y parameter?

zebus
Posts: 2
Joined: 10 Aug 2022, 02:24

Re: BlockInput MouseMove doesn't work while mouse button is held down

Post by zebus » 10 Aug 2022, 13:25

boiler wrote:
10 Aug 2022, 05:55
Unrelated to your question, but why do you have "down" as part of your Y parameter?
Haha, just example of a typo that apparently didn't effect it working lol.

Just started with this like 2 days ago :P

lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: BlockInput MouseMove doesn't work while mouse button is held down

Post by lexikos » 10 Aug 2022, 22:50

The mouse isn't moving during sleep, so there is no reason for BlockInput MouseMove to block input. You would need to block input some other way (such as the default BlockInput mode, InputHook, or a keyboard/mouse hook, depending on what you want to block).

Post Reply

Return to “Ask for Help (v2)”