As long as MAME recognizes all the controllers, you can set whichever controller to be player 2 or 3 or 1 or combinations of all of them including the keyboard and mouse. Just go into the configuration options, go to the button you want to set, press enter, then press the button of the controller you want to use to control that button. You can then press enter again and set an additional controller to use that button. You can repeat this for all controllers.