I'm toying around with game code; basic space ship shooter. I've
assigned these keys for controls:
UP: Thrust
LEFT: Rotate ship counter-clockwise
RIGHT: Rotate ship clockwise
SPACE: Fire laser
Problem is that you can't press certain key combinations (i.e. keys
held down simultaneously):
(in this order)
Press and hold LEFT
Press and hold UP
Press and hold SPACE
I would expect Pyglet to send three on_key_press events, one for each
key press. If I change the above to be keys to be RIGHT, UP, SPACE,
it works as expected.
I've attached sample code that re-creates the problem:
-- BEGIN CODE --
#!/usr/bin/python
import pyglet
from pyglet.window import key
import sys
window = pyglet.window.Window()
@window.event
def on_key_press(symbol, modifiers):
sys.stdout.write('Key:')
if symbol == key.UP:
sys.stdout.write('UP')
elif symbol == key.LEFT:
sys.stdout.write('LEFT')
elif symbol == key.RIGHT:
sys.stdout.write('RIGHT')
elif symbol == key.SPACE:
sys.stdout.write('SPACE')
else:
sys.stdout.write('?')
sys.stdout.write('\n')
@window.event
def on_draw():
window.clear()
pyglet.app.run()
-- END CODE --
Anyone have any ideas?
--
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.