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: Checking for Keyboard Input... Message-ID: <1037@bucsb.bu.edu.UUCP> Date: Sat, 11-Jul-87 15:33:34 EDT Article-I.D.: bucsb.1037 Posted: Sat Jul 11 15:33:34 1987 Date-Received: Sun, 12-Jul-87 16:43:06 EDT Reply-To: eap@bucsb.UUCP (Eric Pearce) Organization: Boston Univ Comp. Sci. Lines: 38 Keywords: keyboard input Xref: mnetor comp.lang.c:2985 comp.unix.questions:3161 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 -- ******************************************************************************* * UUCP : ..!harvard!bu-cs!bucsb!eap |-+-+ +-+-+-+-+-+-+-+\ /-+-+-+-+-+-+-+-+* * ARPANET: eap@bucsb.bu.edu | > : : : - @ - | g * * CSNET : eap%bucsb@bu-cs |-+-+-+-+-+-+-+-+-+-+/ \ +-+-+ +-+-+ +-+* * BITNET : cscc8vc@bostonu | | Blasted by ZAXXON | ; | * *******************************************************************************