Thanks, i found that this script does not cause
a to stuck:
Code: Select all
~MButton & a::
~a & MButton::
Return
Anyway, it looks like I got what I wanted in a different way.
In case anyone is interested, here is my script that allows to perform various actions during a strafe in an FPS game, when the right button is pressed:
Code: Select all
;Remap the movement and aim buttons in the game to be able to stop the player's movement when the right mouse button is pressed
;Move left
a::
if !GetKeyState("RButton", "p")
SetTimer, SendA, 10
Return
a Up::
SetTimer, SendA, Off
Send, {Left Up} ;Remapped left move button
Send, {a Up}
Return
SendA:
Send, {Left Down} ;Remapped left move button
Return
;Move right
d::
if !GetKeyState("RButton", "p")
SetTimer, SendD, 10
Return
d Up::
SetTimer, SendD, Off
Send, {Right Up} ;Remapped right move button
Send, {d Up}
Return
SendD:
Send, {Right Down} ;Remapped right move button
Return
;Aim
RButton::
SetTimer, SendA, Off
SetTimer, SendD, Off
GoTo, Main
Return
;Main script
Main:
Send, {p Down} ;Remapped aim button
if GetKeyState("a", "p")
{
Loop,
{
;Do your stuff here when "a" and "right mouse button" is pressed
if !GetKeyState("RButton", "p")
Break
if !GetKeyState("a", "p")
GoTo, Main
}
}
if GetKeyState("d", "p")
{
Loop,
{
;Do your stuff here when "d" and "right mouse button" is pressed
if !GetKeyState("RButton", "p")
Break
if !GetKeyState("d", "p")
GoTo, Main
}
}
if GetKeyState("RButton", "p")
{
Loop,
{
;Do your stuff here when only "right mouse button" is pressed
if !GetKeyState("RButton", "p")
Break
if GetKeyState("a", "p")
{
Send, {p Up} ;Remapped aim button
GoTo, Main
}
if GetKeyState("d", "p")
{
Send, {p Up} ;Remapped aim button
GoTo, Main
}
}
}
Send, {p Up} ;Remapped aim button
if GetKeyState("a", "p")
SetTimer, SendA, 10
if GetKeyState("d", "p")
SetTimer, SendD, 10
Return
RButton Up::
Send, {p Up} ;Remapped aim button
if GetKeyState("a", "p")
SetTimer, SendA, 10
if GetKeyState("d", "p")
SetTimer, SendD, 10
Send, {RButton Up}
Return