Simulate a buttonpress after some inactivity

Is there any way to “simulate” a buttonpress after say 5 minutes of inactivity by the user.

I want my widget blueprint to default back to the welcomescreen after say 5 minutes of inactivity by simulating pressing the HomeButton… I’ve looked everywhere and i can’t seem to find a satisfactory answer.

Could someone explain an easy way to do this?

Thanks!

Create a CustomEvent and connect it to the same node as the normal button. Once 5 mins have gone past, call that CustomEvent and it will execute the nodes the button was connected to:

217749-sim.png

The OnClicked is a genuine UI button event, the SimulateCancel does exactly what it says.

Does it help?

Alright, thanks. After fiddeling around a bit I got it. Thanks for helping me out.

A new problem arrived though. How can I define 5 minutes of INACTIVITY by the user? As it is now the script has no way of knowing that the user already clicked another button and that the custom event from the last button wich tells it to go to the homescreen is no longer valid. Is there any “monitor user activity” node? lol

Nevermind I got it by playing with the boolean values and if statements, it might not look pretty but it works.

How can I define 5 minutes of
INACTIVITY by the user?

In case you ever look for another solution to monitor player’s inactivity:

Pressing any key or moving the mouse will start the countdown, the BackToMenu CustomEvent will fire when the time is up. Moving the mouse or pressing any key will reset the timer and restart the countdown.