Hi Winkleink, Thanks for the hint. Indeed I heard/read somewhere that joysticks events are working. But keyboard events somehow not. I cut an pasted a bit from your code and came up with the testprogramm below. If you run it, the joystick will trigger events, but the keyboard doesn't ------------------------ import pygame, os, sys from pygame import locals os.environ['SDL_VIDEODRIVER'] = 'dummy' pygame.init() pygame.joystick.init() try: ÂÂ j = pygame.joystick.Joystick(0) # create a joystick instance ÂÂ j.init() # init instance ÂÂ print 'Enabled joystick: ' + j.get_name() except pygame.error: ÂÂ print 'no joystick found.' while True: Â for event in pygame.event.get(): ÂÂÂ print 'event detected' ÂÂÂ if event.type == pygame.QUIT: ÂÂÂÂÂ sys.exit() ÂÂÂ if event.type == pygame.KEYDOWN: ÂÂÂÂÂ print 'key pressed' ÂÂÂ if event.type == pygame.locals.JOYAXISMOTION: # Read Analog Joystick Axis ÂÂÂÂÂÂ print 'joystick moved' --------------------------------------------- On 27/03/16 12:53, Winkleink wrote:
I use dummy in the following project and it worked. |