Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check key pressed pygame

import pygame
events = pygame.event.get()
for event in events:
    if event.type == pygame.KEYDOWN:
        if event.key == pygame.K_LEFT:
            location -= 1
        if event.key == pygame.K_RIGHT:
            location += 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #key #pressed #pygame
ADD COMMENT
Topic
Name
4+8 =