<s> import pygame <EOL> from pygame . locals import * <EOL> from sys import exit <EOL> pygame . init ( ) <EOL> screen = pygame . display . set_mode ( ( <NUM_LIT> , <NUM_LIT> ) , <NUM_LIT:0> , <NUM_LIT:32> ) <EOL> font = pygame . font . SysFont ( "<STR_LIT>" , <NUM_LIT:32> ) ; <EOL> font_height = font . get_linesize ( ) <EOL> while True : <EOL> for event in pygame . event . get ( ) : <EOL> if event . type == QUIT : <EOL> pygame . quit ( ) <EOL> exit ( ) <EOL> screen . fill ( ( <NUM_LIT:255> , <NUM_LIT:255> , <NUM_LIT:255> ) ) <EOL> pressed_key_text = [ ] <EOL> pressed_keys = pygame . key . get_pressed ( ) <EOL> y = font_height <EOL> for key_constant , pressed in enumerate ( pressed_keys ) : <EOL> if pressed : <EOL> key_name = pygame . key . name ( key_constant ) <EOL> text_surface = font . render ( key_name + "<STR_LIT>" , True , ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> screen . blit ( text_surface , ( <NUM_LIT:8> , y ) ) <EOL> y += font_height <EOL> pygame . display . update ( ) </s>
