We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I want to ask a question with text() and make the program wait for my answer. Is there a command for making the program 'wait' for my key(keyPressed)?
Answers
noLoop will stop the automatic looping of draw ()
Umm... actually I didn't mean 'break' I want to make something like 'set /p a=' or 'choice /c ~' at batch kind of wait.(Asking a question and waiting for answer)
https://forum.Processing.org/two/discussion/23646/how-to-use-input-with-python-processing-running-on-a-mac
The draw() function in your sketch is always running. You need to continuously check the keyPresssed function and managed what is input. An example below.
Kf
Tag: usrInput
As has been said, there is no inbuilt method for this. You have to build your own.
I use a state system for that where the program can be in different states.
You can have an
int state
that tells you in which state you are. Initially it's0
, set it to1
for waiting for input and to2
when input is finished and then back to0