How to configure MAME controls correctly?

I just recently finished putting together the Picade 10" on a Pi 3B+. I an existing updated Rasbian install so I manually installed Retropie on that. After finally getting sound working the next problem I have is with the controls inside MAME. I’m using lr-mame2003 as the emulator. I have no idea what’s going on the with the controls – they seem all over the place and even changed on me.

So the first problem I had was the controls were triggering the extra options (like screen record and fast-forward). So was able to edit the retroarch.conf and map those to commands to different keys. The second problem seems to the buttons not mapped to what I expect and opening the MAME menu, etc. The third problem is that the controls don’t seem to work right. Some responsiveness problems.

I noticed that MAME seems to detect the controls as RetroPad as well as a keyboard and that’s causing some conflict. Does that make sense? What is the best way to get the Picade working with MAME?