How can I read keyboard without stopping

Blair P. Houghton bph at buengc.BU.EDU
Fri Aug 19 20:56:29 AEST 1988


In article <51 at yarra.oz.au> bgg at yarra.oz.au (Benjamin G. Golding) writes:
> In article <813 at ms3.UUCP>, isns02 at ms3.UUCP (Harris Reavin) writes:
> > I would like to know if it is possible to get input data from the
> > keyboard while my program is constantly looping and displaying output
>
> 5) A pair of processes and a pipe.  Have the main process create a
>    pipe and spawn a subprocess to do all the work; it can then block
>    reading from the keyboard.  When keyboard input arrives, the main
>    process copies it to the pipe for the other process and sends a
>    signal to notify it that data is waiting there.
>
>    Good: It will work almost anywhere, even V6!  It is simple and
>    natural: there are two tasks to be done, so we have two processes.
>
>    Bad: If we lose a signal we may not get all input as it arrives.

I think I know of an example of this, and a fun one at that!

If you can find it (I don't believe I have a noncorrupted copy), look
at the vrogue extension to the game rogue.  It allows switching two
character sets when sending graphics-characters and ascii to the terminal
under the X window system.

Lemme look...

Aha! I do have it; just not on this computer.  No ftping problem...

Yes, it is neat as all-get-out.  It does some Rube Goldberg plumbing,
(no doubt brilliant to another eye) and handles almost all of the
signals itself.  I don't know of its portability, but I'm certain for
Ultrix 2.2.

I would appreciate someone's telling me what my liability is if I start
passing it around.  I pulled it off the net, myself, but I don't know
whether it should have been there; seems it was part of a systems-software
release once, then not.

Jim Gettys would know.

				--Blair
				  "So would his lawyer, I fear..."



More information about the Comp.unix.wizards mailing list