Re: Is there a getch()?

From: Sammy (samedi@clark.net)
Date: 02/07/96


On Thu, 8 Feb 1996, Eric Green wrote:

> >This is more of a general c question I think.  I want someone to be able
> >to type in a letter and have my code react immediately (not after they
> >press enter).  All of the ansi c books I have say to use getch().  I
> >don't have getch().  It is supposed to be in stdio.h or conio.h.  I don't
> >have a conio.h and it isn't in stdio.h.  I am running linux(bunch of
> >different versions) with gnu c 2.6.3.  Is there another name for getch()?
> 
> If you want to read less than one line at a time, then you have to get the
> telnet client from line mode into character mode.  To do this, you have to
> request the client suppresses go ahead, explained in rfc 858.  This is
> similar to turning echo off:
> 
> From what i've been able to figure out, you have to turn off echoing, and
> handle that yourself.  Otherwise backspaces come out as ^H, and returns as
> ^M.  In order to support noncanonical input, you have to rewrite
> process_input to handle echoing, and to react immediately to certain
> sequences.
> 
> I am trying this stuff for a better string editor.  To reduce the network
> load, the connection in question will only be switched to handle
> noncanonical input when the editor is invoked, and switched back to normal
> after.

Sounds like a big project.  I wonder how much this would slow the mud 
down, if 2 or 3 people were using the editor simultaneously.  Full screen 
redraws would cause some nasty lag.

All the times I've used pine and pico over the net it never occured to me 
that I was sending a lot more packets than were necessary.  Time to 
relearn ed :)

I think circle the circle editor wouldn't be so bad if it just had some 
simple line-editing abilities.  No, I'm not volunteering, I can't even 
write a simple ^M remover :)

Sam



This archive was generated by hypermail 2b30 : 12/07/00 PST