Check out the "aliens" example that comes with Pygame. It shows exactly what you want.
yanom @linuxmail.org wrote:
I have a problem with my pygame project: i used pygame.key.set_repeat(2,2) to make it so that continually holding down the left or right arrow keys moves a character. i have a problem though: whenever i press a key other than left or right, even if i am still holding an arrow key, my character stops moving. here is my code: ... how do i solve this problem?