Non-blocking ReadConsoleInput

后端 未结 1 1409
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-27 02:08

I\'m writing a Win32 console application that interacts with the mouse. I\'m using ReadConsoleInput to get the window-relative mouse movements like so. Here\'s a si

1条回答
  •  隐瞒了意图╮
    2021-01-27 02:24

    This is all documented in ReadConsoleInput. You can determine if there is a console input with GetNumberOfConsoleInputEvents. And you are able to to determine the type of console input events with PeekConsoleInput.

    So GetNumberOfConsoleInputEvents is all you need.

    You can also use WaitForSingleObject with the console handle to wait for a next available input. This is also documented in ReadConsoleInput

    0 讨论(0)
提交回复
热议问题