Need help with BlockInput Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
cleetz
Posts: 30
Joined: 04 Feb 2023, 15:09

Need help with BlockInput

Post by cleetz » 07 Jan 2024, 02:25

Hello. I'm wondering how I would use BlockInput to block my mouse movement outside of the desired script input until after the duration of the code, for example.

Code: Select all

F1::
BlockInput, Mouse     ; Looking to block mouse movement here, clicks also would be ok to block but not required 
mousemove 80, 200
sleep 100
BlockInput, Off   ; Chunk of code over, mouse function returns
Return
I read the page on BlockInput but cant figure out how it works. I usually learn off examples and couldnt understand the ones on the page.
Thanks.

Rohwedder
Posts: 7774
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help with BlockInput  Topic is solved

Post by Rohwedder » 07 Jan 2024, 03:15

Hallo,
try:

Code: Select all

F1::
BlockInput, MouseMove      ; Looking to block mouse movement here, clicks also would be ok to block but not required 
mousemove 80, 200
sleep 100
BlockInput, MouseMoveOff   ; Chunk of code over, mouse function returns
Return
BlockInput, Mouse blocks user's physical movement only during mousemove 80, 200 no longer during sleep 100.

Post Reply

Return to “Ask for Help (v1)”