initial joystick support for python keygrabber (shinydoofy i need your help to test this i dont have a joystick around)

This commit is contained in:
punkrockguy318 2008-12-05 17:41:27 +00:00
parent c063fdaf99
commit e2a63b1107
1 changed files with 6 additions and 3 deletions

View File

@ -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()