Next: Turtles
Up: Graphics
Previous: Mouse Operations
The graphics library contains functions that report key presses
from the keyboard.
The functions get-key-press and ready-key-press
return a ``key-press descriptor,'' and then key-value takes
the descriptor and returns an integer for the key that was
pressed (usually the ASCII value)..
-
(get-key-press viewport)
get-key-press takes a viewport descriptor and returns
a mouse click descriptor.
It returns the next mouse click in the viewport, waiting for a click
if necessary. -
(ready-key-press viewport)
ready-key-press takes a viewport descriptor and returns
either a mouse click descriptor, or else #f if none is available.
Unlike the previous function, ready-key-press returns immediately. -
(key-value key-press)
key-value takes a key press descriptor and returns
an integer for the key that was pressed. Usually this is the ASCII
value of a character. Special keys return other values as defined by
wxWindows, the primitive GUI toolbox. For example, the up arrow key is
represented by the constant wx:k-const-up. -
(viewport-flush-input viewport)
As noted above, key presses are buffered.
viewport-flush-input takes a viewport descriptor
and empties the input buffer of mouse and keyboard events.
This action is useful in some real-time applications.
It returns unspecified.
PLT