Code: Select all
*$w:: {
static toggle := False
SetTimer () => Send('{Blind}w'), 100 * toggle := !toggle ; use lower number for faster spamming
SoundBeep toggle ? 1500 : 500
}
Code: Select all
*$w:: {
static toggle := False
SetTimer () => Send('{Blind}w'), 100 * toggle := !toggle ; use lower number for faster spamming
SoundBeep toggle ? 1500 : 500
}
I'm not sure anything is wrong with how he structured it -- just that he needed it to send multiple keypresses instead of holding it down. But this demonstrates the result of his Send by putting it in a MsgBox instead:DuckingQuack wrote: ↑29 Nov 2023, 05:51@prz Your quotes are out of place if you’re trying to send “w down”… the whole expression needs quotes around it to be included in the send and then each other part that is the expression that isn’t sent but contained within needs extra quotes to remove them… it’s complicated and you’re probably better off putting “w down” in if and “w up” in else.
I can’t test this right now, but it would be something like this:
Send("{Blind}{w " ((KeyDown := !KeyDown) ? "down" : "up") "}") ” ”
I think the two at the end are needed.
Code: Select all
KeyDown := False
MsgBox("{Blind}{w " ((KeyDown := !KeyDown) ? "down" : "up") "}")
; result is: {Blind}{w down}
Code: Select all
XButton1:: {
If !GetKeyState("w", "L") {
SendEvent("{w down}")
} Else {
SendEvent("{w up}")
}
}
Code: Select all
clik := () => Click()
Lalt::
+Lalt::
RCtrl::
+RCtrl:: {
Static on := False
If on := !on
SetTimer(clik, 50), clik()
Else SetTimer(clik, 0)
KeyWait 'Ctrl'
Send '{Ctrl up}{Shift up}'
}
Users browsing this forum: Bing [Bot], mikeyww and 38 guests