Perhaps this belongs in the windows c++ section, I am not entirely sure. But anyway, I was perusing this thread
http://www.cplusplus.com/forum/general/3570/page1.html#msg15410
And I saw some echo and line buffering control. I am aware of what echo does but what does line buffering do?
I also saw this thread which drew similar attention
http://www.cplusplus.com/forum/beginner/16910/#msg85203
If I changed that echo function to this
1 2 3 4 5 6 7 8 9 10 11
|
void linebuffer( bool b )
{
DWORD mode;
HANDLE hstdin = GetStdHandle( STD_INPUT_HANDLE );
GetConsoleMode( hstdin, &mode );
if (b) mode |= ENABLE_LINE_INPUT;
else mode &= ~(ENABLE_LINE_INPUT);
SetConsoleMode( hstdin, mode );
}
|
Would it effectively turn off the line buffering in the same way?
Lastly, while reading the threads on console closing down, I saw the press any key functions. Is there an input mode (akin to the two above) or set of modes that would trigger such input (immediately accepting a keypress)?
EDIT: Oh, and how do you get and recognize special keys such as the F-keys (F1, F2, etc) and combination keys like Ctrl (and various key combinations therein such as Ctrl -A, Alt-X, etc)? What about arrow keys? (And can you differentiate numpad from non-numpad numbers?)