You are on the right track! But we have a tiny tool that can be run to generate the .gamepads file;
gdc.zip (782.8 KB)
Includes binaries for OSX, Windows and Linux. You should just run it from a terminal, like;
./gdc
And it will ask you to press different buttons on your connected controller, the output will be a new gamepads file with correct mappings.
Hope this helps!