On 03/09/13 08:43, Григорий Третьяков wrote: > I have a question relative with that issue (this is all about version > 1.2alpha1 and Linux). > > In pyglet/window/__init__py I see event handlers for keyboard, mouse, > window, but not for joystick. Should I use code like below for handling > joystick event instead of defining those handlers in Window object?
I my experience with 1.2 alpha and joysticks is limited, but I usually use something like this: https://github.com/reidrac/ya-falling-blocks/blob/master/useboxnet/puzzle/control.py I basically wrap the keyboard state handler (so I can get the info about pressed keys using a dictionary) and the joystick handler so I have an unified interface for both controllers. So my answer is that I would use the Joystick interface as event dispatcher (but again, my experience is limited). I don't know if pyglet 1.2 alpha1 docs are online, but you can check: http://code.google.com/p/pyglet/source/browse/pyglet/input/base.py#285 (get the docs from: http://code.google.com/p/pyglet/downloads/detail?name=pyglet-docs-1.2alpha1.zip&can=2&q=1.2alpha1) I think this is the right way to use joysticks/gamepads etc (in fact I only have gamepads and my code works just fine!). Regards, Juan -- 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/groups/opt_out.
