📜  pygame.key.get_pressed() - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:20.077000             🧑  作者: Mango

代码示例3
letters = {x: pygame.key.key_code(x) for x in "abcdefghijklmnopqrstuvwxyz"}

touche = pygame.key.get-pressed()

for (l, value) in letters.items() :
  if touche[value] :
    print(f"The letter {l} has been pressed ;)")