you mean have the handleInput() function within a draw() function? so function draw() { function handleInput() { } }