On Mon, 25 Feb 2002, Howard Lowndes wrote:
> When a user is logged into a rlogin, telnet, or ssh session over TCP sockets
> there is often the occasion that one stroke of the keyboard can produce a string
> of characters (Fkeys, arrow keys, etc)
> 
> What is the best way to keep this string together in a given TCP packet instead
> of being split over 2 or 3 packets.

This is going to sound really daft...

The best way to ensure your keypress packets don't get split is to wait
for the result of each kepress to appear on the screen before pressing the
next key... Thus forcing the client to send lots of little packets that
won't get split, rather than delaying a moment and then sending several
keypresses at once.

> The problem is that at the receiving end there could be a timing problem where
> if the string gets split over more than, say, 10 msec then it not considered to
> be the result of just one keypress, but is considered to be the result of a
> number of individual key presses and thus gets handled differently.

Yeah, there's piles of laments about daft design of dumb terminals all
through the ncurses documentation. Whoever decided to use escape codes and
then put an escape key on the keyboard must have been daydreaming.

I guess you could find a way to just assume that escape won't occur on
it's own... but that's just as bad an option, in my book. Users expect it
to do something.
_I_ should probably do a search, but it's not my promlem. :)
I'll just wait to hear how you do. :)

-- Jessica Mayo.
(Everything with a Grin :)
[and cursing early mornings... Zzz..]

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to