[fpc-pascal]Readkey

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Sat Aug 21 11:20:04 CEST 2004


On Fri, 20 Aug 2004, Marco van de Voort wrote:

> > I'm using the following units on Linux.
> > 
> > USES ports, dos, crt, graph, printer;
> > 
> > readkey doesn't capture keystrokes as they're typed.  It reads them all 
> > in sequence only after the user presses enter.  This is unlike the  way 
> > TP reads the kbd buffer.
> > 
> > Am I doing something wrong?  And Linux terminates kbd strings with LF.  
> >   So I guess I need to account for that.  I'm converting a program which 
> > checks for CR to back up one level on a menu.  Pressing the enter key 
> > returns LF instead.
> > 
> > But my main question is how to read the kbd buffer as keys are 
> > typed.... not after the user presses enter.  readkey doesn't do the 
> > job.
> 
> Multiple possibilities
> 
> - Both graph and crt might interfere both try to capture output. (graph via
> linking in svgalib?)

Yes. 
SVGALib also offers keyboard handling, which is not compatible with CRT. 
There is little we can do about that. 

But: You may want to try to reseverse the order of Graph and CRT in the uses
clause. In that case, CRT will be initialized last, and will set the terminal 
in the proper mode for CRT to function correctly. 

It may confuse svgalib's keyboard handling, though. But as you will probably
only be using CRT routines for that, this should not matter.

Michael.




More information about the fpc-pascal mailing list