X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/8da28f2261c74470f3bf28d8d6f5833113c1b25f..ebfe781349c82c510e0bd51d6ebe5c7e9fad8d65:/usr/src/lib/libcurses/getch.c diff --git a/usr/src/lib/libcurses/getch.c b/usr/src/lib/libcurses/getch.c index 4ff7334224..20ad43d43e 100644 --- a/usr/src/lib/libcurses/getch.c +++ b/usr/src/lib/libcurses/getch.c @@ -1,9 +1,18 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifndef lint +static char sccsid[] = "@(#)getch.c 5.3 (Berkeley) %G%"; +#endif not lint + # include "curses.ext" /* * This routine reads in a character from the window. * - * %G% (Berkeley) @(#)getch.c 1.2 */ wgetch(win) reg WINDOW *win; { @@ -18,7 +27,7 @@ reg WINDOW *win; { fprintf(outf, "WGETCH: _echoit = %c, _rawmode = %c\n", _echoit ? 'T' : 'F', _rawmode ? 'T' : 'F'); # endif if (_echoit && !_rawmode) { - raw(); + cbreak(); weset++; } inp = getchar(); @@ -26,10 +35,11 @@ reg WINDOW *win; { fprintf(outf,"WGETCH got '%s'\n",unctrl(inp)); # endif if (_echoit) { - mvwaddch(curscr, win->_cury, win->_curx, inp); + mvwaddch(curscr, win->_cury + win->_begy, + win->_curx + win->_begx, inp); waddch(win, inp); } if (weset) - noraw(); + nocbreak(); return inp; }