How to get a "Press Any Key to Continue" feature in a Loading Screen from a Main Menu

I found this method to have a “Press Any Key to Continue” work for a widget, since apparently direct Inputs are not allowed on Widgets. It seems to work in a level with a spawned player, but it does not seem to function at all when coming off of my Main Menu.

Can anyone suggest a way I can make this “Press Any Key to Continue” work off of my Main Menu? Basically the Widget gives the player some information about what is in the next level. I want them to read it at their own pace, then press any key to start the level. I would like to avoid Event Tick. Thank you for your time and expertise.

1 Like

since apparently direct Inputs are not
allowed on Widgets

What do you mean by this. Widgets can override onKeyDown/Up. Same with mouse.

1 Like

Hi Everynone, thanks for the quick reply.

I mean that I am unable to call my Action Mapping Inputs on a Widget Event Graph. Would Overrides help me create the “Press Any Key” scenario I’m looking for?

1 Like

Would Overrides help me create the
“Press Any Key” scenario I’m looking
for?

Yup.

  • ensure the widget can accept focus

346255-screenshot-7.png

  • give it keyboard focus

346256-screenshot-8.png

  • override and, optionally, decide which key is the widget supposed to process / consume

1 Like

I think I followed your steps, but I wanted to make sure, because I’ve not seen any change in results.

I made sure the loading screen widget is Focusable.

I set the Keyboard Focus where I constructed the Widget, is that the right place?

I added the On Key Override with the optional Any Key qualifier.

What did I do here? Is it that input are enabled?

1 Like

Looks fine at a glance bar 1 thing.

Swap the order of Add to Viewport & Set Keyboard Focus - I’m almost certain that widgets not in the viewport cannot process anything.

Do tell if that worked.

1 Like

I swapped the order. Its still not responding to input. Could it be something wrong with my initial Blueprint?

1 Like

We shouldn’t be running Tick here, it’s unnecessary. Perhaps we’re in the wrong Input Mode:

The above gives all the input processing to the widget; were you to be in Game Only Input Mode instead, the widget would never have the chance to process anything.

Since we’re in the loading screen, you probably do not want to interact with anything else in the world anyway - so UI only is desirable. Once you’re at the last stage of Press Any Key to Continue, set the Input Mode to the one that your game needs, and remove the widget.


The above works even if the widget has nothing in the hierarchy but it cannot be Hidden or Collapsed ofc.

If it does not work, there might be other things going on that we simply do not see here. Do tell how it goes. Depending on how things line up, the focus might be stolen by something else.

Worst case scenario, you could have this in the widget:

1 Like

I moved the widget from the Main Menu level to the beginning of the first level to avoid the no input problem. How would you suggest I get around Event Tick in this instance? I’ll try some things and report back.

1 Like

These are the two methods I normally circumvent Event Tick, but neither of them seem to work for me here. Any suggestions?

2 Likes

What I did for this was set focus on the widget in the bp begin play. Then on key down and on lost focus load the next map (or do whatever you want). I tried making the widget hit testable and doing on mouse down but then I hit a stack overflow crash in slate… so i just use on lost focus.

  • Create widget and focus in level bp (ignore media player)
  • In widget construct focus again just to make sure (not sure if this is necessary).
  • Override lost focus event in widget since, if it lost focus, then they must have clicked something.
  • Override function On key down in widget
1 Like