On pyglet's
documentation<http://www.pyglet.org/doc/programming_guide/keyboard_events.html>it
is stated that
The Window.on_key_press and Window.on_key_release events are fired when
any key on the keyboard is pressed or released, respectively. These events
are not affected by "key repeat" -- once a key is pressed there are no more
events for that key until it is released.
However when the Unity's keyboard setting called "Key presses repeat when
key is held down" is selected, pyglet (1.2alpha1) will repeat on_key_press
and on_key_release when a key remains pressed.
This unintended behavior can be tested by the following script a toggling
the setting:
import pyglet
window = pyglet.window.Window()
@window.event
def on_key_press(symbol, modifiers):
print "key press"
@window.event
def on_key_release(symbol, modifiers):
print "key release"
pyglet.app.run()
Is there a way to override key repeat for a single window? Any other
workaround is also welcome.
This setting is on by default and it is not pleasant for a game to request
setting it off.
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pyglet-users/-/6Lla_7uzkFkJ.
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.