Module 8 - Section 5 - spaceship

8.5.2 - Move with the Keyboard

Study the following lines:
In these lines pygame checks if arrow keys LEFT, RIGHT, UP, DOWN or keys d, a , s, w are pressed down (KEYDOWN) or released (KEYUP) and moves spaceship accordingly.