import pygame from pygame.locals import * pygame.init() j = pygame.joystick.Joystick(0) j.init() while 1: for event in pygame.event.get(): if event.type == JOYAXISMOTION: print "axis:", event.axis, "value:", event.value elif event.type == JOYBUTTONDOWN: print "button_down:", event.button elif event.type == JOYBUTTONUP: print "button_up:", event.button