import pygame import sys from pygame import * pygame.init displaysurface = pygame.display.set_mode((1910,1000)) while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit if event.type == pygame.KEYDOWN: if event.key == pygame.K_a: print("Key A has been pressed") if event.type == pygame.KEYUP: if event.key == pygame.K_a: print("Key A has been released") pygame.display.update()