key pressed keydown
I have a function1 called, say, 3 times a second. It contains another function2 which should be called if space is pressed:

function1() {

if (keydown.space) function2();

}

The 1st function is used to monitor key presses and respond to them.
I get repetitive function2 calls though I press space only once.
key pressed keydown
===

I have a function1 called, say, 3 times a second. It contains another function2 which should be called if space is pressed:

function1() {

if (keydown.space) function2();

}

The 1st function is used to monitor key presses and respond to them.
I get repetitive function2 calls though I press space only once.