Pygame modules in p3d

I would like to know how to use pygame modules in a p3d. The reason I need this is for joysticks.

Use -r pygame on the packp3d command-line.

Note that pyglet also supports joystick and is easier to integrate by virtue of it being a pure-Python library.

I was unable to get pyglet to work in panda3d, but pygame was pretty straightforward. The issue was that I could not figure out how to get data from the joystick without opening a pyglet window. If anyone has figured this out, I would love to see it. I have not been able to find any working examples.