keygrabber now inits joystick subsystem in sdl
This commit is contained in:
parent
41c1a26b54
commit
fb0220dbd7
|
@ -11,9 +11,13 @@ 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:
|
||||
for event in pygame.event.get():
|
||||
|
|
Loading…
Reference in New Issue