Trying to read keyboard input without blocking (Windows, C++)

前端 未结 2 1521
南旧
南旧 2020-12-21 03:03

I\'m trying to write a Windows console application (in C++ compiled using g++) that will execute a series of instructions in a loop until finished OR until ctrl-z (or some o

2条回答
  •  -上瘾入骨i
    2020-12-21 03:44

    Try ReadConsoleInput to avoid cooked mode, and GetNumberOfConsoleInputEvents to avoid blocking.

提交回复
热议问题