[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] Hi everyone!

From: Gaius Mulley
Subject: Re: [Gm2] Hi everyone!
Date: Mon, 05 Jan 2009 12:48:41 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

"Antonio Gomez" <address@hidden> writes:

> Good Day!
> I wrote this email because i want to know how clear the keyboard buffer.
> It's easy to explain:
>      If i want a character by keyboard, the user press it and then press 
> enter.
>      If i want another char, the Read() get the last Enter, and pass to 
> another
> sentence, saving Enter as second char.(i don`t like it!)
> I know a sentence in C called fflush, it do it, but don't find nothing equal 
> to
> Modula 2.
> Can you help me?
> Thanks!


and welcome!  I think the library Keyboard should do what you want.
This exports KeyPressed and Read - the KeyPressed returns TRUE if
the Read will not block - so you can construct a loop to consume
outstanding characters, rather like this:

   WHILE KeyPressed() DO
   END ;
   (* at this point all outstanding characters are consumed *)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]