mame gamename -verbose
tells you what devices MAME finds connected and their numbers.
D.
I tried that and it didn't help because I hadn't setup my config file for MAME (I normally run MAME32) and all the inputs were defaulted as off. Then I generated a config file and set:
mouse 1
joystick 1
lightgun 1
offscreen_reload 1
When I ran MAME, the lightgun worked!
In fact, I could control it with the mouse or the lightgun. I went to the MAME32 directory to find a similar .ini file, but it did not contain these type of settings. Also, the game I picked (Area51) had the video messed up along with the sound. I guess this is why I run MAME32, because it was easier to set up.
I would think if this works with MAME, then it should work with MAME32.