Author Topic: Remap toggling  (Read 503 times)

So, I've been needing help with making a function that toggles something with a remap, instead of only works when you hold it down. I thought I could simply make it a toggle function, but apparently not.
Code: [Select]
function rainvigtoggle() {
if($rainvigsch != 0) { cancel($rainvigsch); $rainvigsch = 0; clientCmdSetVignette(0, "0 0 0 0"); }
else { $rainvigsch = schedule(1, 0, "rainvig"); }
}
The above runs the schedule while you are holding the key down. How do I make it so I have to press it down again to turn it off?