Controlling controller

I am trying to play MAME games with MAME 2015 and a PS3 controller. I notice sometimes like frogger if you use the analog stick it will jump multiple times and also when playing a lot of games for whatever reason you will pull up the games admin menu and in some games like NARC the game is over at that point. Or in other times I’m playing the game and the settings for changing the key mapping comes up. Not even sure why they are coming up. Any way to prevent this?