How could I go about splitting keyboard & mouse/gamepad controls for 2 players on 1 PC?

Hi all! :slight_smile:

I have a one question about controls.

So, for example we have 2 controllable characters in game for coop.
Is it possible to split Keyboard + Mouse and Gamepad controls for different player controllers, to let 2 people play in coop on 1 PC?

I interesting about Blueprints, but if it’s not possible, ok let it be C++.

Thanks!

I think its possible. for example:
You can bind W-S to P1_MoveForward, And do an axis bind on Left Stick to P2_MoveForward.

Now within the blue print for character1, you use P1_MoveForward and for player 2 character blueprint, you use P2_MoveForward.

There could be more elegant solutions. But this is what I did to move two characters. But in this case, you must relay the MovementInput to second character.

In my case there is only 1 player controller and it has two characters in it.

There is not currently a way to do this automatically. I have a task on myself to look at doing so, but I haven’t any idea when I might be able to get to looking at it.

If you wanted to implement such a thing yourself you would need to extend GameViewportClient and override the InputKey/Axis functions to route the relevant inputs to the appropriate player controller.

Apologies for the inconvenience.

Not sure if there is a new way of doing this now, but what if we override the ID assignment in XInputInterface.cpp to assign gamepad IDs starting from 1 instead of 0, so 0 is always key/mouse?

Hi Marc,

do you have any new information regarding this long lasting issue? It was mentioned now several times and it would be great to somehow solve it. Currently it is possible to reroute the gamepad into the second client, but that doesn’t work with splitscreen setups.

Keyboard = p1 gamepad = p2 please! - Feedback & Requests - Epic Developer Community Forums!

Thanks in advance.

I second this, this is a long-lasting bug.

I’d also like to weigh in. At the moment a 4P local game with various controllers including keyboard and mouse is painful! I think there should be a way to map player index 1 to keyboard and player 2 to gamepad 1 without having to set the mouse and keyboard to be “total gamepads + 1”.

This may be a bit late but if you go to Project Settings->Maps & Modes

Under the Local Multiplayer panel, there is a “Skip Assigning Gamepad to Player 1” option. Check that and you’re good to go