GRAPHIC WAITKEY$ statement  

Purpose

Read a keyboard character, waiting until one is ready.

Syntax

GRAPHIC WAITKEY$ [TO string_variable]

Remarks

GRAPHIC WAITKEY$ waits for a key to be pressed.  It removes the character from the keyboard buffer for the selected graphic target, and optionally assigns it to the string_variable.  If the TO clause is omitted, the keyboard character is discarded.

It returns a string of 0, 1, or 2 characters that reflects the status of the keyboard buffer for the selected graphic target.  A null string (LEN=0) means that there was an error, such as the case when no graphic target has been assigned with GRAPHIC ATTACH.

A string length of one means that an ASCII key was pressed and the string contains the ASCII character.  An ASCII value between 1 and 31 indicate a control code.

A string length of two means that an extended key was pressed.  In this case, the first character in the string has an ASCII value of zero, and the second is the extended keyboard code.

See also

GRAPHIC INKEY$, GRAPHIC INPUT, GRAPHIC INPUT FLUSH, GRAPHIC INSTAT, GRAPHIC LINE INPUT