To confirm, are you running mame4all or mame-libretro?
You get to pick as the game starts (you press x to choose which emulator and video mode etc..)
The video above relates to mame4all
mame-libretro uses the key mappings in your retroarch setup. (Although I dont think I’ve ever used this emulator – shout if you want me to fire it but the mame4all should do it fine)