def_prog_mode和reset_prog_mode刷新后curses键盘不起作用
我正在尝试通过系统调用从 ncurses UI 转到编辑器,然后再返回。在此处几位友好程序员的帮助下,我学习了如何使用 def_prog_mode
和 refresh
在用户从编辑器返回后恢复终端 UI 的状态。
所以我的代码看起来像这样:
// save state and exit ui
def_prog_mode();
endwin();
// system call...
system(...)
// restore ui
reset_prog_mode();
refresh();
这很好地恢复了我的 UI,但通常情况下,此后我的程序不再接受或响应键盘输入。我不确定在什么条件下会发生这种情况,但大多数情况下都会发生。
这似乎与此处的问题类似,但是所描述的修复(再次调用键盘
)似乎不起作用。
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 here, 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论