Ive got the above mentioned program finished and I think it works good, for me anyway.
I think drventure wrote a program that may do the same thing, Im not sure.
If anyone wants to test my program, I can post it.
What does it do?
When you start an emulator (nes just for example), from Mala, the precommand runs my program, which I call paddetect, that is located in the emulators folder.
Paddetect checks to see if a game pad is plugged into the usb port, if it is it rewrites the emulators config file to be set up for the gamepad.
If no pad is plugged in, a config file set up for keyboard is written.
This takes a little work on first setup.
You have to open the emulator, go into its setting, and set it up for keyboard (arcade control panel) inputs.
You then close the emulator, copy the config file, then rename the copied config file something like none.cfg
You repeat this process for 1 gamepad plugged in, second gamepad plugged in, or both gamepads plugged in.
You then have to enter the config names in paddetect's settings file.
If anyone is interested I can go deeper into the setup routine. Its really not that hard, just a little time consuming, but once its set up it should be good to go.
This program could work with any front end, as long as the front end allows you to run a program before starting a game.