我有这个 ncurses 应用程序正在执行标准配方
暂时退出 ncurses,运行外部
编辑器/shell/无论什么,然后在完成后返回 ncurses。
这几乎可以工作,除了 ncurses 的前几个按键
之后得到的显然是假的; ncurses 认为 ^[ 和 A 被看到
如果我按向上箭头两次。
任何人以前见过这种行为并且知道要修复什么魔法
这是?如果有帮助的话,这是 Ruby ncurses 库。
After rootling around a bit, I found a cargo culting solution: explicitly call keypad(1) after getting out the shell on stdscr. I have no idea why this works, but it does. I'll mark someone else's answer as yes if they can explain why. The current working theory is that keypad touches some sort of internal buffer and clears it.
从头开始:
NCURSES_EXPORT(int)
keypad(WINDOW *win, bool flag)
{
T((T_CALLED("keypad(%p,%d)"), win, flag));
if (win) {
win->_use_keypad = flag;
returnCode(_nc_keypad(SP, flag));
} else
returnCode(ERR);
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)