From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5cd788f18b560297 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 28 Nov 2008 16:47:15 +0100 From: Gautier User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.16) Gecko/20080702 SeaMonkey/1.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to get a key from keyboard References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.77.160.43 X-Original-NNTP-Posting-Host: 83.77.160.43 Message-ID: <49301282$1_1@news.bluewin.ch> X-Trace: news.bluewin.ch 1227887234 83.77.160.43 (28 Nov 2008 16:47:14 +0100) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed-0.progon.net!progon.net!news-zh.switch.ch!switch.ch!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news1.google.com comp.lang.ada:2835 Date: 2008-11-28T16:47:15+01:00 List-Id: 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!