Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!ucsd!mvb.saic.com!ncr-sd!se-sd!jim From: jim@se-sd.SanDiego.NCR.COM (Jim Ruehlin, CFC User) Newsgroups: comp.lang.c++ Subject: Re: Using C++ Streams Keywords: portable compilers preprocessors Message-ID: <4515@se-sd.SanDiego.NCR.COM> Date: 28 Mar 91 17:17:53 GMT References: <1991Mar11.181823.9414@falcon.no> <284@nazgul.UUCP> <13731@helios.TAMU.EDU> Organization: NCR Corp., Systems Engineering - San Diego Lines: 17 In <13731@helios.TAMU.EDU> jadam@cs.tamu.edu (James P Adam) writes: > I'm working on a DOS machine, and I'm trying to use the C++ streams >library of stuff to read control-characters from the keyboard. What I'd >like to be able to do, for instance, is to ask for some input (an >integer, say) and be able to abort the request if the first character >hit is the ESCAPE key. > The problem is that characters like ESCAPE, CTRL-S, CTRL-P, CTRL-Z, >etc., never get through to my program if I use cin. > What I used to do, back in plain C, was to use machine-specific I've used streams mostly for file IO, not keyboard. But I know if I have to do binary IO I need to use the read() and write() methods. You may want to try these, or the get() and put() methods. It works for me! - jim ruehlin