Second gamepad won't capture input until first mouse click

Greetings !

So, I was using Unreal 4.5 and I had no problem with second gamepad at all.

After upgrading to 4.6, I noticed something a bit annoying:

When playing in editor, first gamepad works fine( capturing input), but second one WILL NOT capture input until you click at least once using mouse (a click in viewport).

Is this a bug? or is there some change i missed?

Hi FrostSnake,

Thanks for report! I was able to reproduce this in 4.6, and entered a bug report for developers (UE-6622). I will let you know when I see an update for it. Thanks!

Greetings :smiley:

Any news about this? any workaround? my thesis is after 10 days :open_mouth: I gotta fix it soon :confused:

Hi FrostSnake,

There hasn’t been any change yet, but it’s unlikely we’ll see anything until 4.8. For now, you’ll need to click in their viewports first to enable gamepad input.

Sad, but thanks :smiley:

C++ workaround:

Override GameViewPortClient with your own class which overrides ReceivedFocus with this:

    void UYourGameViewportClient::ReceivedFocus(FViewport* Viewport)
    {
    	Super::ReceivedFocus(Viewport);
    #if WITH_EDITOR
    	FSlateApplication::Get().SetAllUserFocusToGameViewport();
    #endif // WITH_EDITOR
    }

You also need to set Game Viewport Client Class to your new class in Project Settings->Engine->General Settings, include SceneViewport.h and SlateBasics.h and add Slate as a dependency in YourProject.Build.cs

Thank you !

I’ve run into same problem. It may be worth looking into this answer as well: https://answers.unrealengine.com/questions/160794/cant-control-player-2-unless-i-click-in-the-viewpo.html

Basically, it was suggested to call SetFocusToGameViewport node in Blueprint, which fixes issue; but, node only works if called after EventBeginPlay. I setup my main menu in my game so that players have to press a button to continue, and when they press that button I move onto next menu screen, as well as call SetFocusToGameViewport. It’s not most elegant way to do it, but it works right now.

Hopefully this will be fixed for 4.8.

Any updates on this issue?

Hey Jonathan,

Sorry, no, there hasn’t been any update yet. I have included a note that there is more community interest in bug report, and I am going to email devs to see if they can bump up priority on issue.

Thanks. Appreciate it.