FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   multiple readkeys
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: multiple readkeys  (Read 205 times)
adriandacanadian

Email
multiple readkeys
« on: Dec 5th, 2003, 5:37pm »

hey, processing can read multiple keys at once right? This seems really basic, but in my code it reads the last key pressed.
 
Any help would be beneficial
Thanks
Adrian
« Last Edit: Dec 5th, 2003, 5:44pm by adriandacanadian »  
fry


WWW
Re: multiple readkeys
« Reply #1 on: Dec 5th, 2003, 9:29pm »

yeah, 'key' only stores the last key pressed. to keep track of keys as they're used, write methods called 'keyPressed' and 'keyReleased'.  
 
void keyPressed() {
  // another key was pressed, use it
}
 
void keyReleased() {
  // one of those keys was released
}
 
as far as keeping track of all the keys that are currently pressed, you'll have to write something of your own, via these methods.
 
Pages: 1 

« Previous topic | Next topic »