when will this button work!

Guys, how do i make a key that will fire each frame when down and stop running the code when released?

Thanks