Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!husc6!bu-cs!bucsb.bu.edu!eap
From: eap@bucsb.bu.edu.UUCP (Eric Pearce)
Newsgroups: comp.lang.c,comp.unix.questions
Subject: Keyboard Input (Revised Question) ...
Message-ID: <1043@bucsb.bu.edu.UUCP>
Date: Sun, 12-Jul-87 20:08:24 EDT
Article-I.D.: bucsb.1043
Posted: Sun Jul 12 20:08:24 1987
Date-Received: Mon, 13-Jul-87 04:23:32 EDT
Reply-To: eap@bucsb.UUCP (Eric Pearce)
Organization: Boston Univ Comp. Sci.
Lines: 44
Keywords: Keyboard
Xref: mnetor comp.lang.c:3005 comp.unix.questions:3167




I would like to write a routine that performs a repeated sequence of statements
(i.e. a loop) that would check for input from the keyboard and do something
according to what was typed in.  Also, it would be able to continue doing the
loop regardless of whether or not anything was typed in from the keyboard.

like this:

    Begin Loop
      check for keyboard input
      if a key was pressed 
                     case
                         1) do something
                         2) do something else
                         ...
                     esac 
      fi
      do some more stuff
    End Loop

I used to be able to do this easily on my Apple ][.  You could check a memory
location to see if a key had been pressed and which one it was, without having
the program wait for user input.   (good for games)

Is there a way to do this in C?  Or maybe a different approach to the problem?
(this is intended for a program on a mainframe)

                                              ANY ideas welcome!

                                                           -Eric
-------------------------------------------------------------------------------
Several people asked what machine I would be running this on:
    Encore MULTIMAX 4.3 BSD UNIX
    and a  VAX 11/750 running the same...
-------------------------------------------------------------------------------
-- 
*******************************************************************************
* UUCP   : ..!harvard!bu-cs!bucsb!eap |-+-+ +-+-+-+-+-+-+-+\ /-+-+-+-+-+-+-+-+*
* ARPANET: eap@bucsb.bu.edu           |    > :   :   :    - @ -  |       g    *
* CSNET  : eap%bucsb@bu-cs            |-+-+-+-+-+-+-+-+-+-+/ \ +-+-+ +-+-+ +-+*
* BITNET : cscc8vc@bostonu            | |  Blasted by ZAXXON   |  ;  |        *
*******************************************************************************