Running two instances on the same machine share XInput

This is a new problem with 4.9 preview.

Launch two or more instances. For example launch a dedicated server and then connect two clients to it, all on the same machine. Set one client window (1) to the foreground/focus window. Note that the other client window (2), also receives XInput (Input from the 360 controller). Switch foreground/focus window to (2) and note that the first window (1) continues to receive XInput.

It stops receiving dual input in our game if we activate and close the inventory screen, possibly because input focus changes or because we call Set Input Mode blueprint node.

Hey Markus Arvidsson,

Would you providing me with some reproducible steps, and some screenshots or your blueprints so I can reproduce what you are reporting on my end?

Thank you,

Hey, I tried this on preview 2 with the first person template c++ project. It happens there, too. You just need to launch that project with the -game parameter twice. So two instances of standalone game. Note how the controller controls both instances and not just the one that has focus. So no need to do a client/server setup.

Hello Markus Arvidsson,

This is a bug that is currently being addressed by our development team.

The ticket number is UE - 18946.

Thank you very much for reporting this bug,

Great, would be awesome if it could be addressed before 4.9 is released :).

This still happens in the 4.10 branch.

Hey Markus,

Thanks for the update. This is marked as To Do and Unresolved. Our developers are doing all that they can do resolve all of the issues that they receive. However, as there is a massive amount of them it’s hard to give anyone a time frame for when and if they will be resolved.

The bright side is it is marked as “To Do” instead of “Backlogged” or “Won’t Fix”

Again, Thank you for the update,

Hello,

I’m still experiencing this bug in 4.21.1-release. I’ve tried searching for the support ticket mentioned above (UE-18946), but can’t find it on UDN or https://issues.unrealengine.com/.

The issue can be reproduced by launching the example third-person project (C++) in at least one standalone (non-PIE) window:

UE4Editor.exe <PROJECT_PATH> -game -log -Windowed -ResX=750 -ResY=500

If you switch focus to any other program (e.g. Notepad) and use a gamepad (e.g. Wired Xbox 360 controller), the character will still move. Launching multiple standalone windows will mean that the controller moves all characters simultaneously, regardless of window focus.

The same behaviour can be observed with a multi-window listen server and client setup:

UE4Editor.exe <PROJECT_PATH> ?listen -game -log -Windowed -ResX=750 -ResY=500
UE4Editor.exe <PROJECT_PATH> 127.0.0.1 -game -log -Windowed -ResX=750 -ResY=500
UE4Editor.exe <PROJECT_PATH> 127.0.0.1 -game -log -Windowed -ResX=750 -ResY=500

It also occurs in the case of a dedicated server with one or more clients:

UE4Editor.exe <PROJECT_PATH> -server -game -log
UE4Editor.exe <PROJECT_PATH> 127.0.0.1 -game -log -Windowed -ResX=750 -ResY=500
UE4Editor.exe <PROJECT_PATH> 127.0.0.1 -game -log -Windowed -ResX=750 -ResY=500

I’ve dug into the engine code in Visual Studio, and it looks like FSlateApplication::SetUserFocus() is being triggered appropriately when I switch back to the window. However, I can also see that FSlateApplication::OnControllerAnalog() is being called when I move the analogue sticks, regardless of window focus.

Is there a fix for this issue? If not, any advice on a workaround would be very helpful.

Thanks,

Mat

I can confirm it still happens for us too in 4.21.

still happen in UE 4.24 .2nd controller need a mouse click to the veiwport