Unfortunately there’s no gamepad-tool for the PI, but there is a program called jstest and in particular a visual one called jstest-gtk. That’s it on the left. You install it on any Linux system, including Raspbian on the Pi with the command
sudo apt install jstest-gtk
Then run it with a jstest-gtk command from a terminal.
It then detects your game pad and responds to button presses and joystick movements.
The weird thing is although my gamepad identifies it as a NEXT SNES but so far attempts to load that have not been successful in the Asteroids game. It loads but doesn’t seem to work and its not recognising the right shoulder button and has A and B buttons muddled up. Yet in jstest, it is clearly able to identify them.
Time I think to create a mapping under Linux with gamepadtool. Unfortunately it doesn’t work on the Hyper-V Ubuntu so it’s time to fetch my Linux laptop and try it on that.