Avoiding Dependence on Punctual Input Under Terminal-Based Systems

Note that input buffering on terminal systems makes it impossible to tell with certainty when the user has or has not pressed a key. Even if there are no keystrokes available from the operating system, the terminal's keyboard buffer may have keystrokes that have not been transmitted. Consequently, programs which depend on completely punctual input will not be portable. Any character which begins a multiple character sequence, as Esc does on DEC terminals, must be pressed twice to generate the appropriate key code. Hence, if your program uses Esc as a special key, users of most terminals will have to press Esc twice to get the desired effect. As a matter of convenience to users, it is best not to use Esc in particular as a special key in programs that will be ported to terminal-based environments.


Home Contents Previous Next