[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Making UPS smart with Pygame and Joystick input socket



Scott Sumner schrieb:
> I believe that the joystick can be initialized and read without a
> window. [...]  If you don't use the event system and just use the
> "read the joystick directly" function I think it'll just work.

You can still use the event module (which depends on the display module)
on a headless server if you set the SDL video driver to 'dummy':

    import os
    import pygame
    os.environ['SDL_VIDEODRIVER'] = 'dummy'
    pygame.display.init()

Just tested this on my Ubuntu 10.04 virtual server.

http://www.libsdl.org/docs/html/sdlenvvars.html
http://www.pygame.org/docs/ref/display.html#pygame.display.init


Chris