raw/cooked single char i/o

arnold at gatech.UUCP arnold at gatech.UUCP
Sat Jun 11 01:32:21 AEST 1983


	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



More information about the Comp.unix.wizards mailing list