. use library function to parse memory string
[minix3.git] / lib / curses / wgetch.c
blob1582f10b29032140ad4240e63193e215d2eaf54e
1 #include <curses.h>
2 #include <stdio.h>
3 #include "curspriv.h"
5 int wgetch(win)
6 WINDOW *win;
8 bool weset = FALSE;
9 char inp;
11 if (!win->_scroll && (win->_flags & _FULLWIN)
12 && win->_curx == win->_maxx - 1 && win->_cury == win->_maxy - 1)
13 return ERR;
14 if (_cursvar.echoit && !_cursvar.rawmode) {
15 cbreak();
16 weset++;
18 inp = getchar();
19 if (_cursvar.echoit) {
20 mvwaddch(curscr, win->_cury + win->_begy,
21 win->_curx + win->_begx, inp);
22 waddch(win, inp);
24 if (weset) nocbreak();
25 return inp;