Re: [Telnet] Altering input modes

From: David Sun (wedget@MCI2000.COM)
Date: 09/07/98

Brian Langenfeld wrote:
>    For the new OLC I'm writing, it'd be really nice to be able to receive
> single-keystroke input from the user (rather than the user hitting 'enter'
> before input is sent to the mud, each keystroke would be sent as it is
> pressed).  Mail readers (such as PINE) and other locally-hosted programs
> often do this, so I'd really like to believe it can be done on a mud.
>    Putting aside the "most people mud with a client" argument (because I
> don't), could anyone with greater telnet experience shed some light on
> this problem?  I checked out the TELOPTs listed in telnet.h (used in
> echo_on( ) and echo_off( )) and tried working with TELOPT_LINEMODE, but
> had no luck.  Some help would be greatly appreciated, thanks.

echo on and echo off don't have much to do with it, and neither
does linemode. with normal telnet clients (non-normal being zmud),
every keystroke is sent in it's own individual packet to
circlemud. circlemud receives them, and just piles them up in the
input buffer. the only thing it looks for is if there are any
ISNEWL's in there. the ISNEWL macro returns true on \r's and \n's.
when it sees that the enter key was hit, then it takes everything
out of the input buffer, which should form one entire command line,
and processes it. what you should do is to make a new variables
in descriptor_data, zero being entire line processing, and one
being single character processing. put an if else thing in
process_input, making it write_to_q every individual character,
regardless if a newline is found or not. then make the OLC
connection states in nanny work with single characters.

"The optimist sees the doughnut, the pessimist sees the hole."

char c[160],z;main(x,d){for/*/      -- Wedge --       /*/(x=159;x--
;c[x]=32);c[79]=z;c[39]=88/*/   /*/;for(d=31;x
=78,puts(c+z),d--;z=80-z)/*/   high school junior   /*/for(;--x;c[x
+80-z]=88-56*!(c[z-!0+x]/*/   mud and game coder   /*/-c[z+x+1]));}

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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