Isn't it already implemented ? Are you using an Xbox controller ?
I have this controller "https://vlebazaar.in/Quantum-QHM7468-USB-Gamepad-with-Dual-Vibration-?gclid=CjwK..." windows 10 mount this controller as USB generic controller and steam reads it as " generic gamepad : quantum-7468-2vs. The game recoganise L1 key as X key and all other key are not functional. This controller works fully in Batocera.linux and steam