www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/07/10:58:09

Date: Mon, 7 Dec 1998 17:12:19 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Phillip Rhodes <mindcrime AT nccoast DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: C++ Question (slightly off topic)
In-Reply-To: <366B9CB8.2351B88E@nccoast.net>
Message-ID: <Pine.SUN.3.91.981207170838.9168H-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Mon, 7 Dec 1998, Phillip Rhodes wrote:

> in other words, I want to do something that creates the effect of
> getch(), reading a keystroke, without having to wait for
> ENTER to be pressed.

You need to switch stdin to binary mode.  Sorry, I don't know how to do 
that exactly in C++.

Keep in mind that binary I/O from stdin, at least in DJGPP, has several
side effects that you should consider.  For example, ^Z no more signals
EOF, ^C doesn't interrupt the program, etc.  For a full description of
these and other issues, and how to work around them, check out the
description of the library function `setmode' in libc.inf library
reference. 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019