Controllers with the same cfg and ID

I have two different controllers with the same cfg file (usb gamepad), vendor id and product id. The only difference is between the buttons B, that for nes is 0 and for snes is 2.

How can I solve it?

:disappointed:

Thanks!