delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/31/04:48:29

Date: Tue, 31 Jul 2001 11:49:04 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Gwen <mb11363 AT chello DOT be>
cc: djgpp AT delorie DOT com
Subject: Re: question about getkey() , time() and how to pick a char from the screen
In-Reply-To: <01c11959$9c6f2d00$108784d5@feta>
Message-ID: <Pine.SUN.3.91.1010731114717.1042K-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 31 Jul 2001, Gwen wrote:

> Here is some little questions :

I suggest in the future to post each question separately.

> Is there an equivalent of getkey() who doesn't wait (taking keys pressed
> 'on the fly' like kbhit() ) ?

You could use `bioskey' with 1 as the command.

> How to use correctly time() ? I tried to make a countdown of 3 sec :
> 
> float quantum=3;
> time_t t=time(NULL);
> while (time(NULL) - t < quantum) {
>   // display the decount to the screen by example
> }
>  
> it works, in fact it works till quantum=1, below (like quantum=0.1) it acts
> as quantum=1, why ?
> maybe the second is the unit of the function time() ?

Yes, `time' returns a value that is the number of seconds since ``the
epoch'', so its resolution is 1 second.

> and my last question : How to retrieve the char displayed at a certain
> position of the screen ?

Try ScreenGetChar.

> Is there a possibility to do that with PDcurses ?

No clue, sorry.  But I'd guess there is no such way.

- Raw text -


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