win_init.c

来自「API」· C语言 代码 · 共 41 行

C
41
字号
/*
 *
 * 周国祥 2001/05/08 Created
 */
#include	<stdio.h>
#include	<curses.h>
#include	<setjmp.h>
#include	<signal.h>
#include	<fcntl.h>
#include	"color.h"

struct	termio stdin_tty;
struct	termio stdout_tty;

zut_win_initscr()
{
	ioctl(0, TCGETA, &stdin_tty);
	ioctl(1, TCGETA, &stdout_tty);

	signal(SIGINT, SIG_IGN);
	signal(SIGQUIT, SIG_IGN);
	signal(SIGTERM, SIG_IGN);
	initscr();
	start_color();
	init_pair_table();
	noecho();
	nl();
	cbreak();
	keypad(stdscr, TRUE);
}

zut_win_endwin()
{
	clear();
	refresh();
	endwin();
	ioctl(0, TCSETAW, &stdin_tty);
	ioctl(1, TCSETAW, &stdout_tty);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?