On 1/10/08, Esteban <[EMAIL PROTECTED]> wrote:
>
> Re: Issue 154:
>
> http://code.google.com/p/pyglet/issues/detail?id=154&can=4&colspec=ID%20Status%20Type%20Milestone%20OpSys%20Summary
>
> I took a look at the code that handles KeyPress/KeyRelease events
> (XLibWindow._event_key; at line 1079). Although the comment
>
>             # Look in the queue for a matching KeyPress with same timestamp,
>             # indicating an auto-repeat rather than actual key event.
>
> talks about comparing timestamps, actually that's never done in the
> code. Only keycodes are checked.

IIRC, an earlier implementation checked for matching timestamps, but
certain Linux setups (i.e., Richard's) didn't always give the same
timestamp to key repeat events.  We tried a variety of tolerances but
couldn't find a threshold that correctly discriminated between key
repeats and genuine key release events.  The current solution ignores
timestamps and works well, AFAIK (within reason -- your test case that
stalls the event loop for long periods of time is unreasonable, I
believe).

> I don't know if the exact test for time is robust across X server
> implementations. Maybe a small tolerance will be needed for some? I'll
> care about that when it bites me.

It has already bitten Richard.  You should find the to-ing and fro-ing
on timestamps and tolerances if you look through the SVN log of that
file.

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to