delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/22/16:50:50

From: broeker AT physik DOT rwth-aachen DOT de
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ncurses
Date: 22 Mar 2000 20:05:37 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 23
Message-ID: <8bb92h$359$1@nets3.rz.RWTH-Aachen.DE>
References: <8ba1va$943$1 AT nnrp1 DOT deja DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 953755537 3241 137.226.32.75 (22 Mar 2000 20:05:37 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 22 Mar 2000 20:05:37 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

wroot AT my-deja DOT com wrote:
> How can I read one keystroke from the keyboard (including but
> not limited to arrow movements, PgUp, PgDn, Del)? I've heard
> it is done with ncurses/curses. If someone could tell me
> which function, header file and namespace I should use, I would
> appreciate it.

'Curses' is a library, originally invented for Unix boxes where it's
meant to handle 'terminals' (those things with a keyboard, a screen, a
serial line, and just about nothing else...), cleverly.  It's about
the most portable of all the unportable solutions to the 'getc without
having to type <Return>' FAQ in the C newsgroups.

'Ncurses' is a new version of it for Unix. On DJGPP, you have
'PDCurses' instead (pdcur24b.zip, in the 'v2tk' directory of the ftp
servers).

The function call is 'getch()', IIRC, the header is <curses.h>.  No
namespace or so, as this is a C library, not a C++ one.  Be prepared
for having to add a few 'extern "C"'s to your code.
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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