Capturing a keystroke in C++

后端 未结 4 1866
星月不相逢
星月不相逢 2020-12-18 13:54

I have been doing some reading, and I see that I can use getch() to get a keystroke. What I have seen is that this is considered bad practice, however I have seen conflicti

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 14:12

    You want to read from the terminal in non-canonical mode. Use tcsetattr() to turn off the ICANON flag.

提交回复
热议问题