Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

key pressed pygame

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 ;)")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #key #pressed #pygame
ADD COMMENT
Topic
Name
3+1 =