I forgot to include something. In my code I had
key_handler = key.KeyStateHandler()
def update(dt):
window.push_handlers(key_handler)
when the accumulation happened. If I comment this out and add pass,
then key press gives 'A key was pressed' until you press '1' or '2', in
which case key press gives 'Ole!' or 'Zamzam!' no matter how many
times you press (replacement). Pushing the handlers was the key.
In my game code I have run into problems with this kind of inconsistent
behaviour.
Some scenes need to check if a key is pressed continuously, so I used
the KeyStateHandler to do that. However I'm also moving between scenes
that define their own on_key_press. This causes some stuff to accumulate
between scenes. What is the recommended way of doing this?
Should I clear the stack whenever I change scenes?
If so do I use remove_handlers()?
--
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 https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.