Step 1; Install MAME:
Open a Terminal (CTRL+ALT+T) and enter the following line in it:
sudo apt-get install mame mame-tools gnome-video-arcade sdlmame sdlmame-tools
Step 2; MAME Configuration:
Start now MAME with this command so that a hidden folder (.mame) is created in your home directory which will contain all emulator settings:
mame
You can now close the emulator. Run this command to create the configuration file for MAME:
cd ~/.mame && mame -cc
The "mame.ini" file will be created in the ~/.mame folder. Edit now this file with this command:
sudo gedit ~/.mame/mame.ini
In "rompath", you can set your own ROM directory path or leave default paths:
Next, create the following directories in the ~/.mame folder:
You can access the rom folder with this command to place your downloaded roms in:
nautilus ~/.mame/roms
As for player controls, you can easily configure them from the main interface of MAME (Configure General Inputs):

Note: While playing a game with MAME, you can exit fullscreen mode by pressing ALT+Enter.