Ui Input Skip Assigning Gamepad to Player 1 still not working. Need Fix/Workaround

Skip Assigning Gamepad to Player1 is fixed except in UI inputs. It doesn’t work with or without Common UI. The first gamepad will control player 2’s character in game like expect. But will control Player 1’s UI. This is making it impossible to do local multiplayer with a skip assigning controller option.
I’m hoping someone can help me fix this. There is a bug report that is marked as Won’t Fix.
UE-77370

Bump

I thought I was on the right track here and I could just use Widget To Focus to easily set user focus manually from the main widget. Then i realized my color blindness tricked me and that output is a Name and not an actual Widget Reference. and reports none unless i manually set it anyways.

Sorry for bumping an old post but I ran across this issue with UE4.25 and I was able to find a quick fix that served my purposes so I wanted to share in case this helps anyone else!

I have a shared-screen multiplayer game where any player can pause the game. We only want the player who paused the game to control the pause screen (although Player 1 can always interact with it via mouse just as a safety measure)

When the player pauses the screen, we add the pause UMG widget to Player 1’s screen and set the Owning Player to the Player Controller that paused the game.

Then, in the Construct event for the UMG widget, we force all 4 Player Controllers to focus the pause menu:

Next, we override the UMG widget’s OnPreviewKeyDown function and do the following:

What we’re doing here is:

  • If the Skip Assigning Gamepad to Player 1 is enabled, AND the key pressed was a gamepad key, the bool will equal 1. Otherwise, it will be 0. We use that 0 or 1 as an offset for the user index that’s inputting the button (The reason we check whether it was a gamepad key is to allow Player 1 to use keyboard inputs.)
  • Then, we check if that matches the expected user index that should be interacting with the UMG widget. In my case, I can use the Owning Player for this. Alternatively, you could have an integer variable and set that to the expected user index when you add the widget to the screen.
  • If the user index + offset matches the expected user index, then we WON’T handle the event here – this prevents the input event from stopping here. Otherwise, if the indexes don’t match, we’ll mark the input event as being handled here and we won’t process anything further.

If you wanted to prevent mouse input, you could override OnPreviewMouseButtonDown and do the same thing. It’s also worth noting that it may be wise to check if the key is a gamepad key before applying the offset.

I do use a heavily modified version of the UINavigation plugin for my game, so this may just work for my use-case, but I figured I’d share just in case!

I’d really like to know why Unreal bypasses the SlateApplication’s input handling in this situation, causing the user index to not get incremented, but unfortunately I just don’t have the time or brain power to do so.

Hope this helps!