Re: [OT] C++ codong problem

From: Serge Skorokhodov (usia@operamail.com)
Date: Thu Jul 19 2001 - 14:17:33 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...

<skip>

Serge Skorokhodov usia@operamail.com

19.07.2001 16:10 (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