changing variable with key input

Hi guys,

I am trying to write a code so when I press a key it changes the value of a variable from 0 to 1. When I press it again, it goes back to 0, and so on. Can anyone help?

Topic archived. No new replies allowed.