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

[pygame] Reading input without pygame.display.set_mode()



  I am using pygame with another application for joystick, sound, and clock support, and it is working greate so far.  The problem is, I want to be able to use the keyboard and mouse as well.  Unfortunately it appears as though keyboard events never get added unless I initialize a pygame window.  This would be ok, except that then of course, that window has to be in focus for the keys to be pressed.  It's a bit messy.  Does anyone know somthing like pygame that allows you to read keypresses and mouse button presses without that library having to take control?  Or maybe a way to get it to work in pygame?

I realize this is somewhat of a fringe request, however I don't see many ways around it.  The problem is the application is not python, only running python scripts, but I need to be able to access keypresses from the python scripts.  It seems a bit odd to me that this works just fine with the joystick, but not with the other input devices.