Language \ Environment \ Comparison
 
Index
 
  The Processing 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: reas at groupc.net
Name  

keyPressed

   
Examples  
// Click on the image to give it focus 
// and press any key 
void loop() { 
  if (keyPressed == true) { 
    fill(0); 
  } else { 
    fill(255); 
  } 
  rect(25, 25, 50, 50); 
} 
Description   The boolean system variable keyPressed is true if any key is pressed and false if no keys are pressed.
   
Syntax  
keyPressed
   
Usage   Web & Application
   
Related   key
keyCode
keyPressed()
keyReleased()
   
© 2004 - 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas