# GETKEY()
> [HTML Version](getkey().htm)
**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 ACCEPT[XS](keyword-types.htm.md). |
| \-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.
**See Also**
• [Accept, Accepn](acceptsbr.htm.md)[XS](keyword-types.htm.md)
• [GET](get_sbr.htm.md)[XS](keyword-types.htm.md) (keyboard or file input)
• [GETX](getx_sbr.htm.md)[XS](keyword-types.htm.md)
• [Tinkey](tinkey_sbr.htm.md)[XS](keyword-types.htm.md)