Open GoogleCodeExporter opened 9 years ago
Original comment by Nicolas.Rougier@gmail.com
on 15 Aug 2009 at 1:47
Has this patch been tested? The following line doesn't make any sense to me:
if len(self.seen) == self.controls:
As best I can tell, self.controls should be a tuple, so this condition will
never be true, and the ControlGroup will
never trigger.
Original comment by m.e.w.ol...@gmail.com
on 16 Aug 2009 at 3:36
Original comment by m.e.w.ol...@gmail.com
on 16 Aug 2009 at 3:55
You're ignoring that EventGroups also get triggered at the end of the select,
which
is what is working for me. You can patch it with:
--- a/pyglet/input/base.py Sun Aug 16 14:13:10 2009 +0200
+++ b/pyglet/input/base.py Sun Aug 16 20:03:25 2009 +0200
@@ -130,7 +130,7 @@ class ControlGroup(EventDispatcher):
def event_for(self, control):
self.seen.add(control)
- if len(self.seen) == self.controls:
+ if len(self.seen) == len(self.controls):
self.trigger()
def trigger(self):
On any account, you do *need* to group events sometimes (for instance for a
tablet).
Original comment by pyalot@gmail.com
on 16 Aug 2009 at 6:04
I'm not disputing the need for this patch. It seems like it fills a very real
need. I was just asking, given that I
don't have a Linux box to test on, whether it actually worked. The fact that it
contained code that was obviously
never executed felt slightly odd to me.
Original comment by m.e.w.ol...@gmail.com
on 16 Aug 2009 at 9:47
If you've got a better idea how to correlate events over time be my guest.
Original comment by pyalot@gmail.com
on 17 Aug 2009 at 6:08
Original issue reported on code.google.com by
pyalot@gmail.com
on 14 Aug 2009 at 2:16