comp.lang.ada
 help / color / mirror / Atom feed
* Re: Reading the keyboard buffer
  2000-11-12  7:19       ` Freelancer
@ 2000-11-12  0:00         ` tmoran
  2000-11-12  0:00           ` Freelancer
  0 siblings, 1 reply; 8+ messages in thread
From: tmoran @ 2000-11-12  0:00 UTC (permalink / raw)


>I used the get_immediate (char, boolean).
>
>When I press a function key though, it doesn't grab it...
  What compiler and OS are you using?  Gnat 3.13p under Win95 returns
the function keys in PC standard fashion as an ascii.nul character
followed immediately by a second character indicating the particular
function key.  e.g. F1 returns ascii.nul then ';'.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Reading the keyboard buffer
  2000-11-12  0:00         ` tmoran
@ 2000-11-12  0:00           ` Freelancer
  2000-11-12  0:00             ` tmoran
  0 siblings, 1 reply; 8+ messages in thread
From: Freelancer @ 2000-11-12  0:00 UTC (permalink / raw)


I have no idea what compiler I'm using. All I know is I'm using ObjectADA
7.2. , a demo version. Got it off the site of Aonix.


<tmoran@acm.org> wrote in message
news:XgsP5.414483$i5.7073378@news1.frmt1.sfba.home.com...
> >I used the get_immediate (char, boolean).
> >
> >When I press a function key though, it doesn't grab it...
>   What compiler and OS are you using?  Gnat 3.13p under Win95 returns
> the function keys in PC standard fashion as an ascii.nul character
> followed immediately by a second character indicating the particular
> function key.  e.g. F1 returns ascii.nul then ';'.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Reading the keyboard buffer
  2000-11-12  0:00           ` Freelancer
@ 2000-11-12  0:00             ` tmoran
  0 siblings, 0 replies; 8+ messages in thread
From: tmoran @ 2000-11-12  0:00 UTC (permalink / raw)


> > >When I press a function key though, it doesn't grab it...
> >   What compiler and OS are you using?  Gnat 3.13p under Win95 returns
> > the function keys in PC standard fashion as an ascii.nul character
> > followed immediately by a second character indicating the particular
> > function key.  e.g. F1 returns ascii.nul then ';'.

> I have no idea what compiler I'm using. All I know is I'm using ObjectADA
> 7.2. , a demo version. Got it off the site of Aonix.
  Interesting.  It works OK in (regular) OA 7.2 for me when linked as a
Windows app (but run in a console window), but ignores the function keys when
linked as a console app.  Sounds like a question for Aonix user's mailing list.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Reading the keyboard buffer
@ 2000-11-12  0:16 Freelancer
  2000-11-12  1:22 ` Jeff Carter
  0 siblings, 1 reply; 8+ messages in thread
From: Freelancer @ 2000-11-12  0:16 UTC (permalink / raw)


Lately, I have been suffering from post-partum stress... No wrong one..
That's something else..


Anyway, I would be quite grateful if someone could lend me a hand on how to
make a simple event-driven loop where the keyboard buffer or whatever it is
I have to check when someone presses a key.

Something that would resemble an algorithm of the sort :

loop
    if keybd buffer equals ascii.eot then
        ... instructions
    end if
    clr_buffer
end loop





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Reading the keyboard buffer
  2000-11-12  0:16 Reading the keyboard buffer Freelancer
@ 2000-11-12  1:22 ` Jeff Carter
  2000-11-12  1:51   ` Freelancer
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Carter @ 2000-11-12  1:22 UTC (permalink / raw)


You might want to look at Ada.Text_IO.Get_Immediate.

-- 
Jeff Carter
"I unclog my nose towards you."
Monty Python & the Holy Grail



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Reading the keyboard buffer
  2000-11-12  1:22 ` Jeff Carter
@ 2000-11-12  1:51   ` Freelancer
  2000-11-12  5:42     ` Jeff Carter
  0 siblings, 1 reply; 8+ messages in thread
From: Freelancer @ 2000-11-12  1:51 UTC (permalink / raw)


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!





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Reading the keyboard buffer
  2000-11-12  1:51   ` Freelancer
@ 2000-11-12  5:42     ` Jeff Carter
  2000-11-12  7:19       ` Freelancer
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Carter @ 2000-11-12  5:42 UTC (permalink / raw)


Freelancer wrote:
> 
> 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...
> 
> 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..

You might want to look at Ada.Text_IO.Get_Immediate.

There are 4 procedures by that name, and one of them should do what you
want.

-- 
Jeff Carter
"I unclog my nose towards you."
Monty Python & the Holy Grail



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Reading the keyboard buffer
  2000-11-12  5:42     ` Jeff Carter
@ 2000-11-12  7:19       ` Freelancer
  2000-11-12  0:00         ` tmoran
  0 siblings, 1 reply; 8+ messages in thread
From: Freelancer @ 2000-11-12  7:19 UTC (permalink / raw)


Interesting. Thank you!

Is there any way to have all the keys, including function keys to be used
with this?
I used the get_immediate (char, boolean).

When I press a function key though, it doesn't grab it...





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2000-11-12  7:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-12  0:16 Reading the keyboard buffer Freelancer
2000-11-12  1:22 ` Jeff Carter
2000-11-12  1:51   ` Freelancer
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

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