import pygame import sys import asyncio pygame.init() clock = pygame.time.Clock() screen = pygame.display.set_mode([600, 500]) base_font = pygame.font.Font(None, 32) async def main(): while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() if event.type == pygame.MOUSEBUTTONDOWN: # Insert code here if event.type == pygame.KEYDOWN: # Insert code here # Insert code here pygame.display.flip() clock.tick(60) await asyncio.sleep(0) asyncio.run(main())