How to use the keyboard for P1 and a gamepad for P2?

I’m working on a local multiplayer game on PC. I want to be able to have Player 1 use the keyboard, and Player 2 be able to use a gamepad.

I’ve done some research, and as of June the best answer was to extend GameViewportClient and override the InputKey/Axis functions; is this still the case?

All you have to do is in the Input settings create different key bindings for each player. For example you could bind W and S to P1_MoveForward and bind gamepad right stick up and gamepad right stick down to P2_MoveForward. Then in your code you could have the Player1 actor use P1_MoveForward to move forward and Player2 actor to use P2_MoveForward to move forward.

I thought of that, but I’m wanting to have it be dynamic; meaning that if I had one player they could choose to use the keyboard or the gamepad. But if I had two players then player one would be keyboard and player two would be gamepad. So, I really need a way to be able to determine where the input should be routed during runtime.