This applet traps key events and prints them out to the screen. If it has focus, it will even trap alt-F4 on windows. The only thing it won't trap are keys that aren't part of the "virtual keyboard" specification, such as platform-specific keys (like the windows key or the "context button" AKA "mimic the right mouse button"). This might be useful, say, if you wanted to implement a "ctrl-f" find functionality inside your applet.
* Most of the code here is taken from a FAQ at faqs.org:
* it's on understanding keyboard events. The tutorial
* there will help. Use arrow keys to move the rect.
* This uses noLoop() - it updates the picture when you
* press buttons or click it.
This illustrates a problem: is there any way in processing to have a class query the state of the environment that calls it, so that it can compensate for it? If you use scale and translate to make a conventional coordinate system, then any fonts you draw to label that system will be upside down. Is there any way I can make TickedLine work regardless if it is called in a scaled environment or not?
Click once to set a point. Move mouse to see a line drawn from that point with tick marks drawn every 40 pixels. Click again to finish that line. Press 'up' to decrease the distance between tick marks by one. Press 'down' to increase the distance between tick marks by one. Press 'right' to increase the thickness of the tick mark by one. Press 'left' to decrease the thickness of the tick mark by one. Press 't' to make the toggle tick mark visibility. Press 'l' to toggle line visibility.
When you click the screen, a perlin bubble is born. It meanders about, restricted to the visible area. Every once and a while, the bounds change. If you wait long enough, an old bubble will even get smaller. After ten minutes or more, it fills in nicely. For whatever reason, this version from Open Processing has been having problems when viewing from macs running firefox. I'm not sure why!