INF: Reading the ESC Key from the Keyboard with _gets

ID Number: Q38023

5.10 6.00 6.00a 6.00ax 7.00

MS-DOS

Summary:

In Microsoft C versions 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version 7.0,

when the ESC key is pressed when entering a keyboard string to be read

with the run-time library function gets, the keyboard buffer is cleared,

and the only characters that are read by the gets function are those

pressed after the ESC key.

This is an MS-DOS command-line feature. The gets function does not

receive the input of the command line until the ENTER key is pressed.

Pressing the ESC key clears the keyboard buffer. If you need to accept

the ESC keystroke, use the getc function.

Additional reference words: 5.10 6.00 6.00a 6.00ax 7.00