Read console input using pygame

后端 未结 5 1557
故里飘歌
故里飘歌 2021-01-13 08:56

Is there anyway to use pygame to get input from the console, rather than having to display a separate window to get input? I\'m using pygame to track how long the keys on th

5条回答
  •  离开以前
    2021-01-13 09:26

    If you just make the window really small using

    screen = pygame.display.set_mode((1, 1))

    you can't see it. So you are clicked into the window but you don't notice.

    If you click anywhere of course it stops working. You have to click on the pygame window icon for it to work again.

提交回复
热议问题