curses keyboard doesn't work after def_prog_mode and reset_prog_mode, refresh
I am trying to go from my ncurses UI to an editor via a system
call and then back again. With the help of several friendly programmers h开发者_如何学编程ere, I learned how to use def_prog_mode
and refresh
to restore the state of my terminal UI after the user returns from the editor.
So my code looks something like this:
// save state and exit ui
def_prog_mode();
endwin();
// system call...
system(...)
// restore ui
reset_prog_mode();
refresh();
This restores my UI quite nicely, but it is quite often the case that afterward my program no longer accepts or responds to keyboard input. I'm not sure under what conditions this happens, but it happens most of the time.
This seems similar to the problem here, but the fix described (calling keypad
again) doesn't seem to work.
精彩评论