test(key){
send "{key down}" ;no
; send "{%key% down}" ;no
sleep 500
send "{key up}"
}
test("w") ;test(w) doesnt work either as per the manual
%key%
works in AutoHotkey v1. For AutoHotkey v2 it says this works but it doesn't :
if InStr(MyVar, "fox")
MsgBox "The variable MyVar contains the word fox."
key:="up"
send "{" key " down}"
is equivalent to
send "{up down}"