comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier@fakeaddress.nil>
Subject: Re: How to get a key from keyboard
Date: Fri, 28 Nov 2008 16:47:15 +0100
Date: 2008-11-28T16:47:15+01:00	[thread overview]
Message-ID: <49301282$1_1@news.bluewin.ch> (raw)
In-Reply-To: <fde5eb69-bb61-4f43-9fad-ed13a0c11ea8@g38g2000yqd.googlegroups.com>

tolkamp wrote:

> In Pascal there is a function Readkey to read a single character from
> the keyboard. Is there a simular function in ADA?

NB: ReadKey is a Turbo Pascal thing.

> I have tried the procedure Get_Immediate(Char, Error) but here you
> have to press the Enter key as well.

Strange... I get immediately each of "[a][b][c][d]..." when pressing 
each of "abcd...", with the following:
--
with Ada.Text_IO; use Ada.Text_IO;

procedure Test_Key is
   c: Character;
begin
   loop
     Get_Immediate(c);
     Put('[' & c & ']');
   end loop;
end Test_Key;
--
Compiled by GNAT, run on Windows.
_________________________________________________________
Gautier's Ada programming -- http://sf.net/users/gdemont/

NB: For a direct answer, e-mail address on the Web site!



  reply	other threads:[~2008-11-28 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-28 15:20 How to get a key from keyboard tolkamp
2008-11-28 15:47 ` Gautier [this message]
2008-11-29  6:15   ` Paul
2008-12-01  7:28     ` christoph.grein
2008-12-22 16:22       ` f.tolkamp
2008-12-22 17:40         ` Georg Bauhaus
replies disabled

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