Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site gatech.UUCP
Path: utzoo!linus!genrad!mit-eddi!mit-vax!eagle!harpo!floyd!vax135!ariel!houti!hogpc!houxm!hocda!spanky!burl!sb1!sb6!emory!gatech!arnold
From: arnold@gatech.UUCP
Newsgroups: net.unix-wizards
Subject: raw/cooked single char i/o
Message-ID: <211@gatech.UUCP>
Date: Fri, 10-Jun-83 11:32:21 EDT
Article-I.D.: gatech.211
Posted: Fri Jun 10 11:32:21 1983
Date-Received: Sat, 11-Jun-83 10:46:48 EDT
Organization: Georgia Tech, School of ICS
Lines: 32


	I am working on and off on a screen editor which I have
adapted to use the (4.1) curses package. The editor makes use of
control characters for doing various things, including things like
DEL and Control-\ which normally send interrupts.
	In order to get one character at a time, I do the following:
(echo is previously turned off, using the noecho() call.)

	raw();
	c = getchar();
	noraw();
	c &= 0177;	/* lop off parity bit */
	return(c);

	The problem when I do this is that I lose all type ahead
when the editor is redrawing the screen or searching or such.
	My question then is, how can I continue to do raw I/O for
the control characters, but keep the type-ahead? I know it's possible,
becuase VI does it.

	Thanks in advance

		Arnold Robbins
		(Unix Apprentice:  Neophyte < Apprentice < Wizard)
-- 
"The parchment and quill pen of Arnold Robbins"

Arnold @ GATech		          (CS Net)
Arnold.GATech @ UDel-Relay        (ARPA)	 School of ICS
...!{sb1, allegra}!gatech!arnold  (uucp)      	 Georgia Tech
...!duke!mcnc!msdc!gatech!arnold                 Atlanta, GA 30332
...!decvax!cornell!allegra!gatech!arnold