Enjoy is a utility that lets USB joysticks and gamepads work with programs that normally expect keyboard input. Each gamepad button can be set to simulate a particular key. For example, the "Fire" button can be set to spacebar, and in any game where the spacebar is used to shoot, the "fire" button can be used instead.
Your gamepads will appear in the Enjoy window. Make sure Enjoy is stopped, and press a button on the gamepad. The left part of the window will show the button you pressed, and the right part lets you set the appropriate action.

Enjoy allows you to have multiple configurations, since you may not want to use the same keys for all programs. You can change configurations manually, or configure a gamepad button to switch to another one. If you name a configuration after an application, it will automatically become active whenever you use that program.

Enjoy (92KB zip). Works with Mac OS X 10.7
Older version (92KB zip). Known to work with Mac OS X 10.5, 6
Source code (128KB zip). Objective-C code, Xcode project, Interface Builder files.
Enjoy is a free program for Mac OS X 10.5+, focused on simplicity. If you are on another platform or need more advanced features, check out:
The application icon is from the Nuvola icon set by David Vignoni and is licensed under the LGPL.
The rest is by Sam McCall and is MIT licensed.