We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › when keyPressed() is run...
Page Index Toggle Pages: 1
when keyPressed() is run... (Read 356 times)
when keyPressed() is run...
Aug 5th, 2009, 9:41am
 
draw() comes to a screeching halt, the code inside the keyPressed() block is run once, then we start back up with a brand new iteration of draw().

Is this correct or am I way off?
Re: when keyPressed() is run...
Reply #1 - Aug 5th, 2009, 11:44am
 
I am not totally sure, but I believe the mouse and keyboard events are managed between two calls to draw(). Now, I think that indeed you don't have a new call to draw() while the callback is running.
Re: when keyPressed() is run...
Reply #2 - Aug 5th, 2009, 12:18pm
 
ah ok cool. so it goes something like

draw()
draw()
draw()
dr[key pressed, but keyPressed() not run yet]aw()
keyPressed() all the code in this block run, values updated, etc.
draw()
draw()
draw()

Thank you!
Page Index Toggle Pages: 1