comp.lang.ada
 help / color / mirror / Atom feed
From: "Freelancer" <freelancer_2001@hotmail.com>
Subject: Re: Reading the keyboard buffer
Date: Sun, 12 Nov 2000 01:51:10 GMT
Date: 2000-11-12T01:51:10+00:00	[thread overview]
Message-ID: <iImP5.483364$1h3.12949798@news20.bellglobal.com> (raw)
In-Reply-To: 3A0DF0EB.B72F613D@acm.org

Jeff Carter <jrcarter@acm.org> wrote in message
news:3A0DF0EB.B72F613D@acm.org...
> You might want to look at Ada.Text_IO.Get_Immediate.
>
> --
> Jeff Carter
> "I unclog my nose towards you."
> Monty Python & the Holy Grail

Thanks.. But from what I have tried with that, it locks until you press a
key, a lot like a getch(); in C... That's not what I want...

I want the loop to cycle without interruption. It checks if a key has been
pressed, if that's the case, then it runs the set of instructions that
correspond to the key that was pressed.

So for example :

loop
    put_line ("Hell O World!");
    if (kbd_buffer = 'E') then
        blah blah blah....
    end if;
    clr_kbd_buffer;
end loop;

Here, it would continuously write the phrase : Hell O World
until the key E was pressed.

Unlike with a get :

loop
    put_line ("Hell O World");
    get_immediate (char);
end loop;

Here it would write only once the phrase, and then wait for a key to be
pressed..

I hope this clarifies a bit more what I'm looking for... Thanks for your
help in advance!

__________________________________________________
May your schwartz be tall and proud and most of all, effective!





  reply	other threads:[~2000-11-12  1:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-12  0:16 Reading the keyboard buffer Freelancer
2000-11-12  1:22 ` Jeff Carter
2000-11-12  1:51   ` Freelancer [this message]
2000-11-12  5:42     ` Jeff Carter
2000-11-12  7:19       ` Freelancer
2000-11-12  0:00         ` tmoran
2000-11-12  0:00           ` Freelancer
2000-11-12  0:00             ` tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox