From fb0220dbd712b78872918c1677c41e576fd86865 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Fri, 5 Dec 2008 22:50:43 +0000 Subject: [PATCH] keygrabber now inits joystick subsystem in sdl --- get_key.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/get_key.py b/get_key.py index d7ba88ad..22831670 100755 --- a/get_key.py +++ b/get_key.py @@ -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: