Pygame only detects mouse events, does not detect KEYDOWN events

后端 未结 3 1995
清酒与你
清酒与你 2021-01-20 15:16

I have written the following simple program which should print out all events detected by pygame.event.get().

import pygame, sys
from pygame.loc         


        
3条回答
  •  粉色の甜心
    2021-01-20 15:54

    For anyone still struggling with this, the issue is documented here on git and is fixed. https://github.com/pygame/pygame/issues/203

    Just uninstall pygame from your venv, then install below version.

    pip install -U https://github.com/pygame/pygame/archive/master.zip
    

    Just tried this and can finally use key events in pygame.

提交回复
热议问题