stopWhen

Determine if the World/interaction/animation should be
stopped. Returning a value of true
discontinues all events (mouse, key, ticks) and causes VoidWorld.lastScene() to be used to draw the final
Scene.

onKey

Change this VoidWorld when a key event is
triggered. The given event is a String that
describes which key was pressed.

Special Key

"up" :

The user presses the up-arrow key

"down" :

The user presses the down-arrow key

"left" :

The user presses the left-arrow key

"right" :

The user presses the right-arrow key

Other keys generate a single character String that
represents the key pressed. For example, Pressing the B key on
the keyboard generates "b" as an event.
If the shift key is held while pressing B then "B" is generated.