JoyToKey program is designed for remapping keys at your controller. I have a working version.
I'm using USB controllers simillar to Sony PS and PS2 controllers to operate my CNC machines. It's easy to assign a key or combination of keys for any button of the controller using Joytokey.
Example of what I've done is in this video.
https://www.youtube.com/watch?v=gcYeB38kki8
You can buy many different controllers at ebay or ali...but i don't recommend previous versions of bluetooth if you're going to buy no-name chinese controller, it will have a delay, I've tried several. It's also better to buy a wired controller or wireless with a dok station, that has a built in charger... You will have to change batteries or charge accus often. Such controllers are like wireless mouse with built in microwave and fridge, they consume alot.