Joystick configuration in PyGame

In the past 2 competitions our team wrote a game that made use of PyGame's joystick API. It featured a configuration menu and fell back to the keyboard when a joystick wasn't present. Both times I basically wrote the same code, so I decided to write and publicly post a tutorial on how to do this with the generic code so that next spring, I can use my USB game pad on EVERYONE's entry :P

http://www.nerdparadise.com/programming/pygame/joystickconfig/