[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Keyboard Problem



I'm having a problem with pygame.key.get_pressed(). Any ideas? Sample code:

<code>

import pygame
screen = pygame.display.set_mode((100,100))
pygame.init()

def Go():
    while True:
        keys = pygame.key.get_pressed()
        if keys[ pygame.K_SPACE ]:
            return
        pygame.display.update()

Go()

</code>

Result: Program doesn't react to hitting Space, and won't quit till forced.