; x button - output y on tap, z on hold $x:: { global ErrorLevel := !KeyWait("x", "T0.3") ; Wait up to 300ms If !ErrorLevel Send("{y}") Else Send("{z}") Return }