any DirectInput-visible gaming controller that has digital buttons or analog axes

Please note that most of MAME's controls are set up for development purposes, which means that most games will work fine with just some form of keyboard control. If you wish to use fancier control schemes, you will probably need to configure them within MAME to your liking.

How do I configure the keys?

Press Tab in-game and choose "Input: This Game". Select the input you want to configure, press Enter followed by the key you want it mapped to.

More fancy key combinations can be made. To map this key OR that key, set one of the keys as before, wait until MAME accepts it, then repeat for second key. To map so two keys have to be pressed at the same time, press both (or more) keys (or press them with a second of each other) after pressing enter. To map a NOT (key1 only if key2 is not also pressed), enter, press first key, then quickly press the second key(s) twice.

"Input: General" can be selected to change all games inputs, and MAME's UI buttons.

This remapping will also work for joystick or mouse inputs if joystick or mouse support is enabled (see below).

Why doesn't the Tab key work anymore?

Most likely you have re-configured the "UI Configure" key, normally Tab, to something else. To restore the default settings, the quickest way is to delete the default.cfg file from the cfg/ subdirectory below the main MAME directory. However this will remove any other general input changes, too.

If you have settings you don't want to lose, you can also edit default.cfg with any text editor, since the input configuration files are in XML format. Open the default.cfg file and find the line that says <port type="UI_CONFIGURE">. Delete that line and all the lines down to and including the next </port> line; this should be five lines. Save the file.

Mouse control is too sensitive / not sensitive enough.

Try increasing the acceleration and sensitivity settings in the Analog Input settings menu after pressing Tab. You might also want to try adjusting the mouse settings inside the Windows Control Panel (Start -> Settings -> Control Panel -> Mouse).

Why doesn't my joystick work?

There can be several reasons for this:

The most common reason is that Mame disables joysticks by default. In your MAME.ini file, look for the "joystick" line reading "joystick 0"; simply change it to joystick 1. If this does not work, try the following:

If your joystick or game controller came with a device driver, you may need to install it first. To do this, refer to the documentation that came with the joystick or joypad itself.

Open the Windows Control Panel (Start -> Settings -> Control Panel) and double click the "joysticks" or "game controllers" icon. See if your controller is recognized there. If it is, proceed further. If not, you may need to add it there, or you may have a problem with the joystick or controller itself, or its device driver.

Effective on the release of MAME 0.161, Directinput version was changed from 7 to 8 for Windows builds. This has caused some external controllers supported by programs such as PPJOY to no longer function in MAME. Currently the only way to fix this is to obtain the official source package and compile tools and make your own build, adjusting the line in the makefile which shows: DIRECTINPUT = 8 and changing this back to 7.

Why doesn't my mouse or trackball work?

The most common solution is, in mame.ini, replace "mouse 0" with mouse 1.

For the mouse to work in MAME, it has to work in windows. So if it doesn't work in Windows (ie. doesn't more the mouse pointer), fix this first as this isn't a MAME problem. However, some virtual mice that work in windows won't work in MAME; MAME is currently using RawInput for mouse and keyboard inputs in Windows XP & Vista, and if the virtual mouse driver isn't RawInput compatible, it won't work in MAME.

What's the differences between "...analog", "...inc", and "...dec" lines seen when changing inputs?

When MAME emulates an analog input in a game, three lines show up in the change input UI menu, unlike the one line for each digital switch like a button. The "...analog" line is for analog controllers, such as analog joysticks, mice and lightguns. The "...inc" and "...dec" lines are so digital controls, such as keyboard or joystick buttons, can be used to control analog input games.

For best control, map a controller's analog axis at the "...analog" line, and not the "...inc" or "...dec" lines; the axis direction should be set in the Analog Controls UI menu.