table - the button attribute values and mouse button value of button mouse button left button middle button right button scroll wheel moved up scroll wheel moved down setting the four keyboard variables change the keyboard variables if event key =k_left or event key =ord(' ')moveright false moveleft true if event key =k_right or event key =ord(' ')moveleft false moveright true if event key =k_up or event key =ord(' ')movedown false moveup true if event key =k_down or event key =ord(' ')moveup false movedown true if the event type is keydownthen the event object will have key attribute that tells which key was pressed down line compares this attribute to k_leftwhich is the pygame locals constant that represents the left arrow key on the keyboard lines to do similar checks for each of the other arrow keysk_leftk_rightk_upk_down when one of these keys is pressed downset the corresponding movement variable to true alsoset the movement variable of the opposite direction to false for examplethe program executes lines and when the left arrow key has been pressed in this caseset moveleft to true and moveright to false (even though moveright might already be falseset it to false just to be sureon line in event key can either be equal to k_left or ord(' 'the value in event key is set to the integer ordinal value of the key that was pressed on the keyboard (there is no ordinal