INKEY$

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 Picomite CMM2

Syntax:
INKEY$

Description:
Checks the console input buffer and, if there is one or more characters waiting in the queue, will remove the first character and return it as a single character in a string. 
If this is a carriage return, it is likely that there will be a line feed character following as often the enter key will produce a CR/LF pair. 
If the input buffer is empty this function will immediately return with an empty string (ie, "").

As well as the standard ASCII keys, you can test for Function keys and arrow keys etc.
The codes for these special keys are here.

 

PRINT "Waiting"
DO:LOOP UNTIL INKEY$ <> ""
PRINT "key pressed"

 DO
   DO
     k$ = INKEY$
   LOOP UNTIL k$ <>""
   PRINT ASC(k$)
 LOOP
 

Last edited: 26 October, 2020