Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ncoast!catfood From: catfood@NCoast.ORG (Mark W. Schumann) Newsgroups: comp.lang.c Subject: Re: Keys Message-ID: <1990Aug16.214621.9896@NCoast.ORG> Date: 16 Aug 90 21:46:21 GMT References: <1990Aug16.160043.20584@eagle.lerc.nasa.gov> Organization: North Coast Public Access *NIX, Cleveland, OH Lines: 28 In article <1990Aug16.160043.20584@eagle.lerc.nasa.gov> vvcns@mars.lerc.nasa.gov writes: > > I was wondering if anybody knows how to make a program accept input >from the keyboard without the user pressing the return key. For example, >if a user is asked a yes or no question and s/he types a y, the program >will continue as if return was pressed. I am working on a VAX/VMS system >v5.1. I would appreciate any help. > Actually, this is not exactly a C question. C thinks 'stdin' is a stream of bytes, not a keyboard. Some operating systems buffer all keystrokes until or some such is struck, and on those systems there is no way to do what you are asking. (CPF/400 on the IBM AS/400 is one notable example near and dear to my heart.) On VMX 5.1, you can use getch() or one of the runtime library functions. Try HELP Run-Time to get started. Good luck! -- ============================================================ Mark W. Schumann 3111 Mapledale Avenue, Cleveland 44109 USA Domain: catfood@ncoast.org UseNet: ...usenet.ins.cwru.edu!ncoast!catfood ============================================================