Re: [AD] Keyboard timing problem

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2007-06-01, Colin Ward <lists@xxxxxxxxxx> wrote:
> Hello Peter
> 
> On 01/06/2007, you wrote:
> > 
> 
> [Snipped Amiga port]
> 
> > I didn't realise you were targeting the 4.9 branch.  Cool.  The
> > events/input stuff won't be changing much any more, but other stuff
> > like graphics will be changing, so if you want something stable you
> > should target the 4.2 branch, or maybe the 4.3 branch that we are
> > planning on opening.
> 
> Um, I think I'm missing something here.  I have ported 4.3.1, which I
> downloaded from a Sourceforge link that I found on www.allegro.cc.  In
> docs/txt/allegro.txt it says "Version 4.3.1 (WIP)."  Does this use the new
> keypress system?

Yes.  Ok, it's a bit confusing right now but what used to be called 4.3 is now
going to be called 4.9.  The other "4.3 branch" that I mentioned is something
else.  See http://wiki.allegro.cc/AllegroRoadmap

> The problem is, to quote yourself, that the program is unlikely to check
> key[] just at the time the key is held down.
> 
> ie.  The main (user's) thread is paused waiting for vsync(), then the input
> thread sees that key "x" has been pressed, marks key[x] as being pressed
> and goes back to sleep.  The user then lets go of key "x" and the input
> thread wakes up and marks key[x] as being unpressed.  Then the main thread
> wakes up, checks key[x] which of couse is now marked unpressed, and so the
> user thread has missed the keypress.
> 
> But surely this problem would appear on all ports, except thos that ignore
> vsync()?

Yes.

> This new keyboard API that you mention, is it in 4.3.1?  If so, could you
> give me a pointer to the files/functions to look at?

Incredible, you implemented it without knowing what it is :-)  See here:

  http://wiki.allegro.cc/NewAPI/Events

  http://alleg.sourceforge.net/internaldocs/files2/allegro/events-h.html

Peter





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/