delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/17/08:45:29

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE3359D65@probe-2.Acclaim-Euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Allegro keypressed() always returning False
Date: Thu, 17 Dec 1998 13:42:24 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

Graeme Fenwick writes:
> I'm having problems with Allegro's keypressed() function. It seems 
> to be returning false, regardless of what the user types in.

Nope, you just aren't checking the value properly...

>   if (!keypressed());
>      return NO_KEY;       /******** PROBLEM HERE!! *** buffer empty?

Get rid of the semicolon from the end of your if statement. With that 
in place, you have two totally different lines, so the return will 
always be executed regardless of the keypressed() status.


	Shawn Hargreaves.

- Raw text -


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