On Oct 11, 2012 4:34 AM, "Wallace Davidson" <[email protected]> wrote: > > Is it possible to have both of these in a program? I have: > > @window.event > def on_key_press(symbol, modifiers): > if symbol == key.ESCAPE: > return pyglet.event.EVENT_HANDLED > > def update(dt): > if keys[key.W]: > print "hi" > code.... > > But only the on_key_press function is recognised. Would it be better to have one or the other? >
If you're handling key presses you should use the appropriate event handler. Anything that needs to be run that isn't a user input event e.g. simulation should be scheduled with pyglet.clock.schedule, schedule_once or schedule_interval -- 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.
