Hi, I'm trying to make a super-basic script to make one of my mouse buttons toggle the key L in order to turn a regular flashlight in a tactical shooter into a strobe light. It works, but it has a major issue, which I will explain in a moment.
$*~XButton2:: ;mousebutton 2 to toggle
t := !t
Send p ;toggle flashlight
sleep 75 ;75 ms between flashes
The problem is that this script also spams other keys (shift, control, windows, or alt) under certain circumstances. If I just press mousebutton2, everything works as intended. However, if I hold down shift while the "p" spam is activated, the script begins to spam both "p" and shift. This only occurs with the shift, control, windows, or alt keys (I can hold down any regular key with no problems.)
This causes me to be unable to do things like crouch, sprint, etc. ingame while using this script, so it's pretty major. I've messed around with this for a couple hours but as you can probably tell I have no idea what the problem is so I figured someone else might.
Thanks a lot for the help!