def on_key_down(self, key, mod, unicode):
x, y = self._player_pos
if key in (keys.DOWN, keys.UP, keys.LEFT, keys.RIGHT):
+ firing = (keys.X in self._held_keys)
self._held_keys.clear()
self._held_keys.add(key)
+ if firing:
+ self._held_keys.add(keys.X)
# We do this so pressing the key has an instant effect, and can
# then be held
self._last_key_down = self._key_rate + 0.01