delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/10/16:06:23

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Key Detection in Allegro
Date: Wed, 10 Sep 1997 18:40:32 GMT
Organization: [posted via] Easynet Group PLC
Lines: 28
Message-ID: <3416e8d4.22849342@news.easynet.co.uk>
References: <3416103D DOT 4537 AT voyageur DOT ca>
NNTP-Posting-Host: foot.easynet.co.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Tue, 09 Sep 1997 22:13:01 -0500, "J.E." <cellis AT voyageur DOT ca> wrote:

>I am writing a game with Allegro, but I'm having some problems.  I want
>there to be a loop that checks, each time through the loop, for a key
>press, and continues if there is none.  I tried using kbhit() to check
>the key buffer, but it would still just sit there waiting with getch(). 
>I am assuming that kbhit() is working fine, but I need an alternative to
>getch().  I need a function, similar to getch(), that reads a key from
>the buffer WITHOUT pausing.  

Allegro's equivalent of getch() is readkey() [approx equivalent,
anyway] and its equivalent of kbhit() is keypressed(). These work
after calling install_keyboard(), and getch and kbhit do not work
after calling install_keyboard().

>Also, I've been having some problems linking Allegro.  About 50% of the
>time it links fine, but sometimes Rhide says this:
>
>no errors
>The Error was: PERMISSION DENIED  (EACCESS)

A wild stab in the dark: Are you running under Win95, with several DOS
boxes open, one running the program and the other running RHIDE? If
this is the case, make sure you quit your program in its DOS box
before recompiling from RHIDE.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

- Raw text -


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