This took me a while to set up, because it took me a few hours to realize you have to select "All devices", and you can right-click the controls to set multiple keybinds across multiple devices or combinations. I also had to learn that temporarily switching from keyboard to the PS2 controller doesn't work as a shortcut, unless you go into the configuration file and copy and paste "DInput/0/Twin USB Joystick:" before each PS2 button. I hope it saves someone else some time. It's only a partial keybind, because I've only set the buttons relevant to Super Mario Galaxy so far. If you have any suggestions or a better version of these keybinds, I would love to see it. (Before I edited this post, I was originally asking for help getting Super Mario Galaxy to work at all.)
Mouse_and_PS2_controller_Super_Mario_Galaxy_default.ini
[Profile]
Device = DInput/0/Keyboard Mouse
Buttons/A = `Click 0`|`DInput/0/Twin USB Joystick:Button 2`
Buttons/B = `Click 1`|`DInput/0/Twin USB Joystick:Button 0`
Buttons/1 = `1`
Buttons/2 = `2`
Buttons/- = Q|`DInput/0/Twin USB Joystick:Button 9`
Buttons/+ = E|`DInput/0/Twin USB Joystick:Button 9`
Buttons/Home = RETURN
IR/Up = `Cursor Y-`
IR/Down = `Cursor Y+`
IR/Left = `Cursor X-`
IR/Right = `Cursor X+`
Shake/X = `Click 2`
Shake/Y = `Click 2`
Shake/Z = `Click 2`
IMUAccelerometer/Up = `Accel Up`
IMUAccelerometer/Down = `Accel Down`
IMUAccelerometer/Left = `Accel Left`
IMUAccelerometer/Right = `Accel Right`
IMUAccelerometer/Forward = `Accel Forward`
IMUAccelerometer/Backward = `Accel Backward`
IMUGyroscope/Pitch Up = `Gyro Pitch Up`
IMUGyroscope/Pitch Down = `Gyro Pitch Down`
IMUGyroscope/Roll Left = `Gyro Roll Left`
IMUGyroscope/Roll Right = `Gyro Roll Right`
IMUGyroscope/Yaw Left = `Gyro Yaw Left`
IMUGyroscope/Yaw Right = `Gyro Yaw Right`
Extension = Nunchuk
Nunchuk/Buttons/C = LCONTROL|`DInput/0/Twin USB Joystick:Button 4`
Nunchuk/Buttons/Z = LSHIFT|`DInput/0/Twin USB Joystick:Button 6`
Nunchuk/Stick/Up = W|`DInput/0/Twin USB Joystick:Axis Y-`
Nunchuk/Stick/Down = S|`DInput/0/Twin USB Joystick:Axis Y+`
Nunchuk/Stick/Left = A|`DInput/0/Twin USB Joystick:Axis X-`
Nunchuk/Stick/Right = D|`DInput/0/Twin USB Joystick:Axis X+`
Nunchuk/Stick/Calibration = 100.00 141.42 100.00 141.42 100.00 141.42 100.00 141.42
Nunchuk/Shake/X = Click 2
Nunchuk/Shake/Y = Click 2
Nunchuk/Shake/Z = Click 2
D-Pad/Up = UP|`DInput/0/Twin USB Joystick:Hat 0 N`
D-Pad/Down = DOWN|`DInput/0/Twin USB Joystick:Hat 0 S`
D-Pad/Left = LEFT|`DInput/0/Twin USB Joystick:Hat 0 W`
D-Pad/Right = RIGHT|`DInput/0/Twin USB Joystick:Hat 0 E`
Options/Sideways Wiimote = False
Mouse_and_PS2_controller_Super_Mario_Galaxy_default.ini
[Profile]
Device = DInput/0/Keyboard Mouse
Buttons/A = `Click 0`|`DInput/0/Twin USB Joystick:Button 2`
Buttons/B = `Click 1`|`DInput/0/Twin USB Joystick:Button 0`
Buttons/1 = `1`
Buttons/2 = `2`
Buttons/- = Q|`DInput/0/Twin USB Joystick:Button 9`
Buttons/+ = E|`DInput/0/Twin USB Joystick:Button 9`
Buttons/Home = RETURN
IR/Up = `Cursor Y-`
IR/Down = `Cursor Y+`
IR/Left = `Cursor X-`
IR/Right = `Cursor X+`
Shake/X = `Click 2`
Shake/Y = `Click 2`
Shake/Z = `Click 2`
IMUAccelerometer/Up = `Accel Up`
IMUAccelerometer/Down = `Accel Down`
IMUAccelerometer/Left = `Accel Left`
IMUAccelerometer/Right = `Accel Right`
IMUAccelerometer/Forward = `Accel Forward`
IMUAccelerometer/Backward = `Accel Backward`
IMUGyroscope/Pitch Up = `Gyro Pitch Up`
IMUGyroscope/Pitch Down = `Gyro Pitch Down`
IMUGyroscope/Roll Left = `Gyro Roll Left`
IMUGyroscope/Roll Right = `Gyro Roll Right`
IMUGyroscope/Yaw Left = `Gyro Yaw Left`
IMUGyroscope/Yaw Right = `Gyro Yaw Right`
Extension = Nunchuk
Nunchuk/Buttons/C = LCONTROL|`DInput/0/Twin USB Joystick:Button 4`
Nunchuk/Buttons/Z = LSHIFT|`DInput/0/Twin USB Joystick:Button 6`
Nunchuk/Stick/Up = W|`DInput/0/Twin USB Joystick:Axis Y-`
Nunchuk/Stick/Down = S|`DInput/0/Twin USB Joystick:Axis Y+`
Nunchuk/Stick/Left = A|`DInput/0/Twin USB Joystick:Axis X-`
Nunchuk/Stick/Right = D|`DInput/0/Twin USB Joystick:Axis X+`
Nunchuk/Stick/Calibration = 100.00 141.42 100.00 141.42 100.00 141.42 100.00 141.42
Nunchuk/Shake/X = Click 2
Nunchuk/Shake/Y = Click 2
Nunchuk/Shake/Z = Click 2
D-Pad/Up = UP|`DInput/0/Twin USB Joystick:Hat 0 N`
D-Pad/Down = DOWN|`DInput/0/Twin USB Joystick:Hat 0 S`
D-Pad/Left = LEFT|`DInput/0/Twin USB Joystick:Hat 0 W`
D-Pad/Right = RIGHT|`DInput/0/Twin USB Joystick:Hat 0 E`
Options/Sideways Wiimote = False