Been a long time since I messed with it, but since nobody else has chimed in.
This works for a lot, but not all games:
http://forum.arcadecontrols.com/index.php/topic,96377.0.htmlI used that until Injustice came out. I could not get anything to work for Injustice, so I switched to hacked xbox360 fight pads. (wires from my buttons soldered to the gamepad pcb).
I kept the keyboard encoder for ESC and a couple other buttons.
This worked fine on Windows 7. It did take some swapping to get P1 & 2 correct for both games that used xinput and dinput, but once they were set they stayed in order.
The only issue I ran into was that some games (Mortal Kombat X IIRC) required me to map every button on the fightpad, but I only had 7 buttons per player.
I had to jumper a wire to get through the mapping screen, but all was good after that.
All was well until I updated the cab to Windows 10. The windows controller IDs would not stay in order after that.
I gave up and went back to the keyboard encoder and deleted the Steam games from the cab. That was several years ago. I have not tried again since.
I still may go back to windows 7 and switch back to the hacked gamepads.