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=2.6 required=5.0 tests=BAYES_40,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!apple!julius.cs.uiuc.edu!rpi!leah!bingvaxu!ub!planck!corsair!westley From: westley@corsair.uucp (Terry J. Westley) Newsgroups: comp.lang.ada Subject: Re: Keyboard input Message-ID: <1990Sep19.192717.13113@planck.uucp> Date: 19 Sep 90 19:27:17 GMT References: <39@screamer.csee.usf.edu> Sender: news@planck.uucp (Usenet News) Reply-To: westley%hercules@planck.UUCP (Terry J. Westley) Distribution: comp.lang.ada Organization: Calspan Corporation ATC Buffalo, NY List-Id: In article <39@screamer.csee.usf.edu> stelmack@screamer.csee.usf.edu (Gregory M. Stelmack) writes: >Is there any way in Ada to read single keystrokes from the keyboard? Not the >GET from TEXT_IO which requires a carriage return before sending the data, but >as soon as a key is pressed have it sent? We have a whole Ada class that would >like to know, and no one here can help figure it out. So, I ask the net. >We've checked books and can't figure it out. > >Thanks, >-- Greg Stelmack >-- Email: stelmack@sol.csee.usf.edu >-- USmail: USF Box 1510, Tampa, FL 33620-1510 >-- Amiga: the only way to compute! This is typically a function of the terminal driver, not Ada. In Unix (SunOS), you have to call ioctl to put the terminal in "raw" mode and call fcntl to request that the SIGIO signal be delivered to your process. If SIGIO is being used for anything else (such as socket communication), you've got a conflict that must be resolved. I've also done it for VxWorks. I can see where one could implement a different Text_IO that does this, but I doubt if any vendors supply it automatically. Terry J. Westley Arvin/Calspan Advanced Technology Center P.O. Box 400, Buffalo, NY 14225 acsu.buffalo.edu!planck!hercules!westley