Exemple #1
0
static void
main_loop()
{
	int p = 0;
	int c, n;
      L:
	show_all();
	sh(p);
	fflush(stdout);
	while (1) {
		c = getch();
		if (c == 3 || c == 4 || c == 27 || c < 0)
			break;
		if (c == 257 && p > 0)
			p--;
		if (c == 258 && p < counts - 1)
			p++;
		if (c == 259 && p < counts - 19)
			p += 19;
		if (c == 260 && p >= 19)
			p -= 19;
		if (c == 13 || c == 10) {
			bbsnet(p);
			goto L;
		}
		for (n = 0; n < counts; n++)
			if (str[n] == c)
				p = n;
		sh(p);
		fflush(stdout);
	}
}
Exemple #2
0
static int bbsnet_onselect(struct _select_def *conf)
{
    bbsnet(conf, conf->pos-1);
    bbsnet_redraw=true;
    return SHOW_REFRESH;
}