void keyPressed() { if (key == CODED) { if (keyCode == UP) { // action here } else if (keyCode == DOWN) { // more action here } } else { // do something } }
I'm programming in Java. I want the PApplet extension to pass on the key that's pressed to other classes. The problem is, I can't write a method that takes the "key" parameter without knowing what it is. What kind of thing is "key," and what do I import in the other classes to make sense of it?