www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/07/22:30:36

From: "Damian Yerrick" <NOSP AT Musenet@pineight.8m.com>
Newsgroups: comp.os.msdos.djgpp
References: <82jugt$tid$1 AT nnrp1 DOT deja DOT com>
Subject: Re: reading dual keyboard input
Lines: 40
Organization: Pin Eight Software <http://pineight.8m.com/>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <S1j34.1151$2y6.32800@dfiatx1-snr1.gtei.net>
X-Trace: +r2abjoOcZMHLlsG3O88CZ+eSWBCSlZ/WKXrAuPwyTGaEzsQZ5saMEHhblwGC2Npg/g88MLRQEZ0!jqIuaIR7+QlaEa/V6+o9hOC4XwPmpf+MSa4tWRVrjreYEfW2QMpNju02Jsi9mc7szDL22xWJzQ==
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Wed, 08 Dec 1999 02:05:38 GMT
Distribution: world
Date: Wed, 08 Dec 1999 02:05:39 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

<trinitychaos AT my-deja DOT com> wrote:
> 'kay, a problem I've had when using allegro for doing keyboard input.

Make sure you called install_keyboard() first.

> I'm writing a game where two players can both access the keyboard at
> once.  I've got no problem doing this, if each player presses the keys
> rapidly, they each get a go, more or less in order.  The problem I've
> found, though, is that if one of them holds down a key, their hold down
> is remembered, but as soon as another key is pressed and released, the
> held down key is ignored, and they have to release the key and hold it
> down again.  Why is this, and what can I do about it?

You are using event-based (readkey()) keyboard input.
If you were using poll_keyboard() and key[], this wouldn't
happen. See the end of the Allegro example "exkeys"
where it reads several number keypresses at once.

Another resource for Allegro programmers is the official
mailing list. Find out more at the Allegro web site:
http://www.talula.demon.co.uk/allegro/


--
Damian Yerrick    http://yerricde.tripod.com/
My .sig is too long to include in an e-mail or NG message.
Go to http://www.rose-hulman.edu/~yerricde/sig.html to see it.










and now you must pay...


- Raw text -


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