UMG - Prevent Tab From Robbing Player Controller Input with Widgets On Screen

Hey UE4 Community,

I’m having trouble using the tab key to drive functions in my PlayerController blueprint.

In my test project, I’m just drawing a debug string at (0,0,0), which works perfectly if I have no UI elements on the screen. But when I add a UserWidget on the screen, pressing tab will set focus to that widget on the first time, and any movement input will immediately stop (WASD controls). Subsequent tab presses will work just fine, until you click into the game again. Here’s the PlayerController blueprint:

I know from [this answer][2] that I can uncheck Is Focusable to prevent this from happening, but it’s a pain to have to do this for every button and any other widget that can be focusable. Also, sometimes I DO want the widget to be focusable, so unchecking the Is Focusable won’t be an option there.

Is there any way to prevent Tab from focusing and just have it behave like any other keypress?

You can download the test project here: [TabTest][3]

Thanks Sean! So there’s no way to disable the tab toggle completely? I feel like that should be a project settings feature.

Hello,

You could try using the Set is Focusable node to toggle it on and off when you need it to be focusable. Other than that, the tab key will always toggle the focus to the on-screen widget.

The tab toggle is a default functionality of UMG, which means that you would most likely have to delve into the engine code to alter or remove it.

Using the Set is Focusable node worked in my case when I was testing this issue back in December. You can use that to work around the functionality if you’d like to use the Tab key in your game.

This seems very strange to me. If you are using tab for other things in your game, but you want a text input box (eg for chat) to work with a keyboard shortcut, you’re screwed?

Hey Sean,

I can confirm this works in 4.11! I had to toggle the IsFocusable checkbox, compile the blueprint, the toggle it once more to get my desired IsFocusable state, then recompile for all my UMG widgets. Strangest fix but tab totally works now.