My Mouse Button 5 on my Naga Trinity is failing. While holding the button down, it would randomly release without me physically releasing the button and quickly go back to the held down state. My approach is to have it so that if a release is detected, wait 200 ms while continually sending the button down signal. If after 200 ms the button is still detected as released, stop sending the button down signal. The problem is that my script isn't working. I don't know if it is a problem with the approach or with my implementation. Any help would be appreciated.
Script:
Code: Select all
#Persistent
XButton2::
Send {XButton2 down}
Sleep 10
If (GetKeyState("XButton2","P")=0) {
Sleep 200
If (GetKeyState("XButton2","P")=0){
Send {XButton2 up}
return
}
}
return
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code!]
[Mod edit: Moved topic from AHK v2 help since this is v1 code.]