Code: Select all
Activated := false
Rapid := false
MButton & RButton::{
global Activated := !Activated
if (Activated) {
ToolTip "Activated", 100, 100
SetTimer () => ToolTip(), -2000
} else {
ToolTip "Deactivated", 100, 100
SetTimer () => ToolTip(), -2000
}
}
~LButton::
{
global Rapid:=true
while GetKeyState("LButton","P") and Activated{
Send "{LButton down}"
Sleep 45
Send "{LButton up}"
Sleep 45
}
}
After some googling, I found that 'Sleep' sometime may affect the GetKeyState making it cannot return the actual state.
Then, here is version 2
Code: Select all
Activated := false
Rapid := false
MButton & RButton::{
global Activated := !Activated
if (Activated) {
ToolTip "Activated", 100, 100
SetTimer () => ToolTip(), -2000
} else {
ToolTip "Deactivated", 100, 100
SetTimer () => ToolTip(), -2000
}
}
~LButton::
{
if (Activated) {
FireLButton
SetTimer FireLButton, 90
}
}
LButton Up::
{
SetTimer FireLButton, 0
}
FireLButton() {
Send "{LButton down}"
SetTimer () => Send("{LButton up}"), 45
}
For those who want to do the same thing, hope this may help
[Mod action: Moved topic to the Gaming section.]