Curses question

Guy Harris guy at auspex.auspex.com
Thu Aug 16 06:33:18 AEST 1990


>(editor's note: This may be a duplicate transmision.  Sorry if you got it
>twice)

I only saw it once, but I did see the matching posting in
"comp.sys.sun"....

>The first one involves interpretation of input keys.  How can one tell the
>difference between the forward and backward tabs??  When I run my test   
>program, I get 0x09 for both.

As noted, the problem here is that in a "shelltool" window, there *is*
no difference.  What's more, different terminals may transmit different
things for the "backward tab", assuming they even have one; the BSD
"curses" doesn't have any way of recognizing the particular terminal's
notion of a "backward tab" sequence and translating it into some common
code for "backward tab".  The S5 "curses" might be able to do that.

>In addition, the code I'm getting in my test program for a return is
>different that the code which is returned in the real program (0x0a vs.
>0x0d) and yes, these two programs are being run on the same system.      

But probably *not* with the same modes.  0x0a is NL, and 0x0d is CR. 
The RETURN key on most terminals - including the "terminal" emulated by
a "shelltool" - sends CR; however, in some modes the UNIX tty driver
turns CR into NL.  Check out such "curses" functions as "nl()" and
"nonl()", which affect whether this mapping is in effect....



More information about the Comp.unix.wizards mailing list