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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!uunet!amdahl!ames!ncar!gatech!mcnc!decvax!mandrill!asheem From: asheem@mandrill (Asheem Chandna) Newsgroups: comp.lang.ada Subject: Handling Interactive Input from the Keyboard Buffer Message-ID: <2409@mandrill.CWRU.Edu> Date: 8 Apr 88 16:51:29 GMT Sender: asheem@mandrill.CWRU.Edu Reply-To: asheem@mandrill (Asheem Chandna) Organization: Center for Automation & Intelligent Systems Research, CWRU. List-Id: Hi, I was wondering if anyone has a working solution, or can perhaps give me a few pointers, on handling interactive input from the keyboard buffer during program runs. I have a large simulation program with many tasks in it. During every time loop, I want to do a check to see if the user has typed anything from the keyboard. If he (or she) has, then I want to pull up the user menu. If he hasn't, then I just want the program to continue WITHOUT waiting for user input. Since, I'd like to do this every time loop, I'm also looking for a low overhead way to do it (for e.g., I'd rather not have a delay based time-out on every loop). So, basically, I'm looking for an elegant way to have the user interrupt a program run. Currently, I have a solution which basically uses Asynchronous System Traps (ASTs) on Digitals VAX/VMS system. If the user types a certain control sequence, then using ASTs, an entry call is issued to the specified task within the Ada simulation program. On every loop, that task simply checks the entry'count to see if the user wants to interrupt the program. While this solution works, I'd like to use an approach that is simpler, and more portable. Any help will be greatly appreciated. Thanks in advance! Asheem Chandna Center for Automation & Intelligent Systems Research Case Western Reserve University (216)-368-5118 asheem@mandrill.cwru.edu (asheem@129.22.16.1) ...!{cbosgd,decvax,sun}!mandrill!asheem