I'm having some problems getting ncurses' getch() to block. Default operation seems to be non-blocking (or have I missed some initialization)? I would like it to work like getch() in Windows. I have tried various versions of
timeout(3000000);
nocbreak();
cbreak();
noraw();
etc...
(not all at the same time). I would prefer to not (explicitly) use any WINDOW
, if possible. A while
loop around getch(), checking for a specific return value is OK too.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…