From e2a63b110789d246d31c17f1403ef95d5bd9c501 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Fri, 5 Dec 2008 17:41:27 +0000 Subject: [PATCH] initial joystick support for python keygrabber (shinydoofy i need your help to test this i dont have a joystick around) --- get_key.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/get_key.py b/get_key.py index 0ce84401..d7ba88ad 100755 --- a/get_key.py +++ b/get_key.py @@ -21,9 +21,12 @@ class KeyGrabber: pygame.display.quit() return event.key # TODO: Make work with joystick. Do buttons first. - #if event.type == JOYBUTTONDOWN: - # pygame.display.quit() - # return event.joy, event.button + if event.type == JOYBUTTONDOWN: + pygame.display.quit() + # TODO: Make sure we're returning the data we need + # for config file here. I'm not sure if this is + # the correct data. + return event.joy, event.button if __name__ == "__main__": kg = KeyGrabber()