Processing has provided a very good way to introduce students to programming (and to OO), and the immediate gratification of visual output is very effective.
However, the lack of keyboard input is very frustrating!
(This often forces me into very-distracting subterfuges in order to teach students how to write simple algorithms to process keyboard input!)
After years of frustration with this, I finally broke down and created some code to allow keyboard input in real time (rather than restricting input to prepared files).
My solution now allows students to write sketches that solicit user input, but this approach is not very slick and somewhat “klunky” (since you have to write code that detects missing input and prompts the user to supply it, while suspending the draw() method).
Therefore, I welcome comments and suggestions.
Here is a link to a code example that accepts keyboard input for missing values.
When the program begins, the user must input (x,y) coordinates.
If the ‘x’ or ‘w’ or ‘c’ key is pressed, values become undefined (negative) for porition, size, or color (respectively), and user input is solicited.
Yeah, it’s very klunky (and the coding is a bit tedious and ugly), so I am very open to a better solution (while preserving keyPressed() method for other things).