Conditional to make spacebar work on two states