EDIT — I found it at last, the API is SetConsoleMode and it works well.
Code: Select all
DWORD previousMode; // typically(?) 0x1f7
GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &previousMode);
auto newMode = previousMode & (~ENABLE_PROCESSED_INPUT);
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), newMode);