I'd like to make a toggle key (Mbutton) to turn on/off this 'BlockInput MouseMove/MouseMoveOff' AHK statement.
I'm new to AHK and pretty much to all the other programming languages. Pls be patient on where I got wrong below.
(I'm not even sure the way that I put the variable is correct)
Code: Select all
Mouse_Blocked := false
$~MButton::
If (Mouse_Blocked := false)
{ KeyWait MButton ;
BlockInput MouseMove ;
Mouse_Blocked := true
return
}
else If (Mouse_Blocked := true)
{ KeyWait MButton ;
BlockInput MouseMoveOff ;
Mouse_Blocked := false
return
}
I found out this works but it's working when the key is pressed down
Code: Select all
Loop
{
if (GetKeyState("MButton"))
{
BlockInput MouseMove
}
else
{
BlockInput MouseMoveOff
}}