keygrabber now inits joystick subsystem in sdl

This commit is contained in:
punkrockguy318 2008-12-05 22:50:43 +00:00
parent 41c1a26b54
commit fb0220dbd7
1 changed files with 4 additions and 0 deletions

View File

@ -11,8 +11,12 @@ class KeyGrabber:
""" KeyGrabber is a wrapper that gets an SDL key from the user using pygame """
def __init__(self, width=300, height=100):
pygame.init()
pygame.joystick.init()
if pygame.joystick.get_count() > 0:
print "Joystick found!"
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Press any key. . .")
def get_key(self):
while 1: