Hi,

I don't know if it's the same situation but it sounds similar. Yesterday I
tried to update pyglet to 1.2.0 for my game and found that it won't handle
events anymore. Could not do anything - even closing the window did not
work. After some fiddling I found that something in the event routines has
been simplified. If I restore the following code, my events are working
again. Haven't had the time creating a bug report, yet. Perhaps we can sort
it out this way :)

diff -r 51e19c899644 pyglet/app/xlib.py
--- a/pyglet/app/xlib.py Sun Feb 15 16:36:50 2015 +0100
+++ b/pyglet/app/xlib.py Mon Feb 16 15:50:46 2015 +0100
@@ -107,6 +107,11 @@

         pending_devices, _, _ = select.select(self._select_devices, (),
(), timeout)

+        # Check for already pending events
+        for device in self._select_devices:
+            if device.poll():
+                pending_devices.append(device)
+
         if not pending_devices:
             return False

Cheers,
Oktay.

Alessandro Re <[email protected]> schrieb am Mon Feb 16 2015 at
15:36:30:

Hello,
>
> I started recently to use cocos2d, but I had an issue. Since cocos uses
> pyglet, a very kind user translated my code to pure pyglet and the result
> is that, in pyglet, I am unable to process events while animation are
> running. If no animations are running, events are handled correctly by the
> callbacks, otherwise, it seems that events are randomly handled (with low
> probability of being handled).
>
> The discussion about cocos, if you are interested, is here:
> https://groups.google.com/forum/#!topic/cocos-discuss/6uviIoGzII8
>
> The pyglet code I'm talking about is the following:
> http://pastebin.com/W5vLtubk
>
> If I run it, and I press some keys, the label is not updated.
> If I comment the line "pyglet.clock.schedule(update_actor)", events are
> correctly handled and I can see pressed keys appearing.
>
> Note that the code does not work in python2 either.
> I am using Fedora Linux 21, Mesa drivers 10.4.3 for OpenGL, pyglet 1.2.0,
> python 3.4.1 or 2.7.8.
> I also tried with pyglet from the repository, but result is the same.
>
> Am I the only one with this issue? Looks something pretty weird.
>
> Thanks in advance
> ~Ale
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pyglet-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to