【发布时间】:2017-05-13 03:14:13
【问题描述】:
我想知道是否可以使用 termcaps 保存多个光标位置,以便以后能够恢复它们?
例如:
char *c_pos_1 = tgetstr("sc", NULL); //save cursor position at position 1
后面的代码
char *c_pos_2 = tgetstr("sc", NULL);
后面的代码
char *c_pos_3 = tgetstr("sc", NULL);
后面的代码
tputs(c_pos_2, 1, my_out); // restoring cursor at c_pos_2
以及后面的代码
tputs(c_pos_1, 1, my_out); //restoring cursor at c_pos_1
如果不可能怎么办?
感谢您的帮助:)
【问题讨论】:
-
为什么不使用像 ncurses 这样更舒服的东西?
-
这是一个学校项目,我们只能使用termcaps
-
ncurses 使用 termcap
-
是的,但我只能使用函数 tgoto、tgetstr、tgetnum、tgetflag 和 tputs。不幸的是没有别的。