struct string inkeyS()
InkeyS attempts to read a character from the current file (see initio(io)). This function waits no more than one second for a character or character sequence to arrive (see alarm(io)). If no character is present, the null string is returned. If a single character is present, a one character string is allocated and returned. If a character sequence (or is the null character) is present, inkeyS allocates and returns a two character string consisting of a null character followed by another character code as given in the table below.
The interpretation of special function keys requires knowledge of the sequences
generated by the terminal. This information is gleaned from the terminal
capabilities database which is termcap(5) or terminfo(4), depending
on the ancestry of the system. If a particular sequence for a given terminal is
not defined, this function will not recognize the sequence as such. In this
case, The Intrepid Reader who has mustered the audacity to modify the
database will find in the table below the i.codes used with termcap and the
capnames and term structure names used with terminfo.
Code | I.Code | Capname | Term Name | Description | |||||
3 | — | — | — | Null character | |||||
58 | k0 | kf0 | key_f0 | Function key F0 | |||||
59 | k1 | kf1 | key_f1 | Function key F1 | |||||
60 | k2 | kf2 | key_f2 | Function key F2 | |||||
61 | k3 | kf3 | key_f3 | Function key F3 | |||||
62 | k4 | kf4 | key_f4 | Function key F4 | |||||
63 | k5 | kf5 | key_f5 | Function key F5 | |||||
64 | k6 | kf6 | key_f6 | Function key F6 | |||||
65 | k7 | kf7 | key_f7 | Function key F7 | |||||
66 | k8 | kf8 | key_f8 | Function key F8 | |||||
67 | k9 | kf9 | key_f9 | Function key F9 | |||||
68 | ka | kf10 | key_f10 | Function key F10 | |||||
71 | kh | khome | key_home | Home | |||||
72 | ku | kcuu1 | key_up | Cursor up | |||||
73 | kP | kpp | key_ppage | Page up | |||||
75 | kl | kcub1 | key_left | Cursor left | |||||
77 | kr | kcuf1 | key_right | Cursor right | |||||
79 | kH | kll | key_ll | End (Home down) | |||||
80 | kd | kcud1 | key_down | Cursor down | |||||
81 | kN | knp | key_npage | Page down | |||||
82 | kI | kich1 | key_ic | Insert | |||||
83 | kD | kdch1 | key_dc | Delete |
Characters read from a full-duplex tty are not echoed.
If the current file is a half-duplex tty (see io(inc)), inkeyS simply allocates and returns a string consisting of a single character read from the current file.
This function resets the current file.
If this function is used to poll the file during other processing and there is no input available, a delay is created.
from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber