Preventing the code from running until mousePressed is called

10 views
Skip to first unread message

emf...@gmail.com

unread,
May 4, 2018, 8:35:09 AM5/4/18
to Processing.js
I have setup the following listener functions, but they do not seem to stop the code from running. I want them to pause until the mouse is pressed, with these functions being called at various points within the main code setup.

 void MouseListen()
 {
   if (mousePressed=false)
   {
     noLoop();
   }
   else
   {
     mousePressed();
   }
 }
 
 void KeyListen()
 {
   if (keyPressed=false)
   {
     noLoop();
   }
   else
   {
     keyPressed();
   }
 }
Reply all
Reply to author
Forward
0 new messages