In this menu you can look up or change the keys MAME uses. If you change any keys in this menu it will save the settings in a file called default.cfg in the cfg folder. If you mess it up completely then delete the default.cfg file and the keys will reset to default.
Select user interface and you'll see this...
These are the default keys for MAME's interface.
Select a Player Control and you'll see this...
These are the keys for the default game controls.
Select Other Controls and you'll see this...
These are the keys for the non control keys in game.