[fpc-pascal] Unit crt
Rainer Stratmann
rainerstratmann at t-online.de
Wed Sep 23 19:25:26 CEST 2015
On Wednesday 23 September 2015 18:24:54 you wrote:
> On 23/09/15 15:06, Rainer Stratmann wrote:
> > On Wednesday 23 September 2015 13:19:28 you wrote:
> >> >Rainer Stratmann wrote on Wed, 23 Sep 2015:
> >>> > >Does an example exist to turn off (and on) the rawmode?
> >> >
> >> >You posted the routine to do that yourself in the first mail of this
> >> >thread (the last one).
> >
> > There is not enough information available at the moment to me to do so.
> >
> > I need the information what CFMakeRaw(Tio) does. I can not find the
> > source.
>
> cfmakeraw is a C routine that is implemented in a C library.
>
> However, you can just call SetRawMode(false) before you want the output
> to be "normal" (and in the process prevent the crt unit from functioning
> correctly) and call SetRawMode(true) when you want to use the crt unit's
> functionality again.
var oldio : termio.termios;
procedure crt_output_set_normal;
var tio : termios;
begin
tcgetattr( 1 , tio );
oldio := tio;
// !
tio.c_oflag := tio.c_oflag or OPOST or ONLCR;
// !
tcsetattr( 1 , TCSANOW , tio );
end;
procedure crt_output_restore;
begin
tcsetattr( 1 , TCSANOW , oldio );
end;
More information about the fpc-pascal
mailing list