Page 1 of 1
Disable mouse movement for all hotkeys in script
Posted: 08 Aug 2022, 05:47
by John1
I want to disable the mouse movement for all hotkeys in my script. (The mouse movement i send physically.) Can i disable it for all hotkeys in the whole script instead writing at every single hotkey "BlockInput, MouseMove" "BlockInput, MouseMoveOff"?
And i also would like to when disabled it for all enable it manually for some.
Thank you!
Code: Select all
1::
BlockInput, MouseMove
sleep, 200
MouseMove,30,20,0
sleep, 2000
BlockInput, MouseMoveOff
return
Re: Disable mouse movement for all hotkeys in script
Posted: 08 Aug 2022, 06:05
by boiler
Code: Select all
1::MouseMoveEx(30, 20)
2::MouseMoveEx(50, 70,, False) ; not blocked
MouseMoveEx(x, y, speed:=0, block:=True, preDelay:=200, postDelay:=2000) {
if block
BlockInput, MouseMove
Sleep, preDelay
MouseMove, x, y, speed
Sleep, postDelay
BlockInput, MouseMoveOff
}
Re: Disable mouse movement for all hotkeys in script
Posted: 08 Aug 2022, 07:38
by John1
@boiler
Thanks a lot for your reply!
I mean:
i have a lot of hotkeys in the script and want not change them manually. Can i change the default behavior of the script like adding something in the auto section. So it only disable mouse movement when one of the hotkeys is running.
Thank you!
Re: Disable mouse movement for all hotkeys in script Topic is solved
Posted: 08 Aug 2022, 09:51
by boiler
John1 wrote: ↑
I mean:
i have a lot of hotkeys in the script and want not change them manually. Can i change the default behavior of the script like adding something in the auto section. So it only disable mouse movement when one of the hotkeys is running.
I doubt that’s possible. Depending on how you have your hotkeys set up, you may be able to replace all the MouseMove statements with calls to MouseMoveEx() if you know how to use the RegEx mode of find/replace in an editor like Notepad++ or VSCode.
Re: Disable mouse movement for all hotkeys in script
Posted: 10 Aug 2022, 12:23
by John1
@boiler Ok. Thank you again for your answer!