GETKEY

GETKEY(X {,xltname})

This function inputs and returns the ASCII decimal value of a single character. The parameter X must be one of the following:

Value

Description

0

Don't wait for input. If no characters are available, returns -1. This is similar to XCALL TINKEY.

-1

Wait until a character is entered. This is similar to XCALL ACCEPT.

-2

Check if a character is available, but don't input it. Returns -1 if no character is available. (Some versions have returned 0 to indicate that a character is available, and others have returned the actual character value. For maximum compatibility, you should treat anything other than -1 as indicating that a character is available, but then input it using one of the other modes to determine its actual value.)

 

The optional xltname argument may be used to specify a function key translation table to process the character through if it is a function key.

Note that the return value of 999 indicates an invalid value of X. (A common mistake is to use 1 or 2 instead of -1 or -2.)