In windows API, there is SetConsoleMode function.
Among the mode values, I cannot understand the ENABLE_PROCESSED_INPUT value.
The MSDN document says
ENABLE_PROCESSED_INPUT : value (0x0001) :
CTRL+C is processed by the system and is not placed in the input buffer. If the input buffer is being read by ReadFile or ReadConsole, other control keys are processed by the system and are not returned in the ReadFile or ReadConsole buffer. If the ENABLE_LINE_INPUT mode is also enabled, backspace, carriage return, and line feed characters are handled by the system.
Does it mean that when this flag is set, CTRL+C is not placed in the input buffer(because it’s handled by the system)? or is it otherwise(CTRL+C is placed in the input buffer)? The explanation is confusing to me.. Please can anyone explain it to me?
It means that Ctrl+C will not be put in the input buffer if the
ENABLE_PROCESSED_INPUTflag is set (instead, the system will handle it and send theSIGINTsignal to the process running in the console).The same behavior applies to the
ENABLE_LINE_INPUTflag: if it is set, characters likebackspace,carriage returnandline feedare not put in the input buffer and are handled by the system (erasing characters from the buffer and processing end-of-lines automatically).