This is from the html manual:
Barney
KeyHit( keycode ) Check for key hit Returns: Number of times key has been hit. KeyHit also resets the count for the key specified to zero. See the KeyCodes docs for a list of valid keycodes. Example: ' keyhit.bmx ' the following code draws a circle every time the ' program detects the spacebar has been pressed ' and exits when it detects the ESCAPE key has ' been pressed Graphics 640,480 While Not KeyHit(KEY_ESCAPE) Cls If KeyHit(KEY_SPACE) DrawOval 0,0,640,480 Flip Wend
Barney