Re: [OT] C++ codong problem

From: Serge Skorokhodov (usia@operamail.com)
Date: Thu Jul 19 2001 - 15:27:19 CEST


Hi everybody,

VPP> I would like to read a character from keyboard as it is
VPP> pressed for my menu system, but I havenät found a way to do
VPP> it, every function that I have found has to wait until enter
VPP> is pressed so send the buffer to my program. If there is a
VPP> way, please tell me.

> Try add a line like this in the beginnig of you C++ file:
>
> #include <conio.h>
>
> and use the function you can find there. Just look:
>
> while ( !kbhit() )
> {
> do_something_very_meaningful();
> do_something_even_more_meaningful();
> }
>
> The loop will be ended up as soon as a key pressed on the
> keyboard.
>
> The only bad news is that conio.h may not be available for some
> shells:( I'm not *nix programming expert though, but I guess
> conio.h is quite POSIX...

It seems that I gave a bad advice:( as conio.h doesn't seem to be
portable to *nixes:( Unfortunately, I only have a w2k machine at
hand right now and I've look through Borland C++ help. Any
console input/output routines portable to UNIX shell I've found
require ENTER be pressed before the buffer becomes available for
application:( The only thing I can think about right now in
ncurses library but I hardly know any details:( Sorry for
misleading message.

<skip>

Serge Skorokhodov usia@operamail.com

19.07.2001 17:27 (Moscow time)

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:19 CET