Don't know if this will help, but when you see this screen when only the keyboard is responsive, hit the ENTER key and the first control input (UP) will be voided, then you press the Up input on your gamepad and proceed to do a similar action for the rest of the inputs. Select OK when done with the Enter key. After that, the gamepad should be functional.
If that doesn't work, maybe you should download a program like
JoyToKey or something and see if that works.