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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4a23491ada1f36bd,start X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Using Get_Immediate to read keystrokes. Date: 1998/08/26 Message-ID: <6s1615$20k@hacgate2.hac.com>#1/1 X-Deja-AN: 384922811 References: <98082016293577@psavax.pwfl.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Hughes Aircraft Company Newsgroups: comp.lang.ada Date: 1998-08-26T00:00:00+00:00 List-Id: Marin David Condic, 561.796.8997, M/S 731-96 wrote in message <98082016293577@psavax.pwfl.com>... > So I got a request from a user to improve the behavior of a little > command line oriented application. Currently the application uses > Ada.Text_IO.Get_Line to read in commands. The user wants to use > the up-arrow key to recover previous commands. > I see no evidence that this hasd been answered, so I'll tell you how I do it. I use Ada subprograms pragma-interfaced (is that a word?) to the tcgetattr and tcsetattr functions. If memory serves me correctly, I have three subprograms, viz.: One is Set_Echo_Mode with an enumeration parameter (On, Off), and the other two are called Save_Console_State and Restore_Console_State. I got the Idea to use these functions from reading the a-sysdep.c file in the gnat distribution. Hope this helps, David C. Hoos, Sr.