# Is there a way to detect when the game goes to background?

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-detect-when-the-game-goes-to-background/614990>\
**Category:** Blueprint\
**Tags:** Event-Handler, unreal-engine, UE4, Blueprint, question\
**Created:** [July 26, 2022, 9:12pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-detect-when-the-game-goes-to-background/614990 "2022-07-26T21:12:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![barracius-AOne](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/barracius-aone/32/548049_2.png) [@barracius-AOne](https://forums.unrealengine.com/u/barracius-AOne)\
**Post date:** [July 26, 2022, 10:21pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-detect-when-the-game-goes-to-background/614990/2 "2022-07-26T22:21:04Z")

</div>

Hi there @FranCalvente !

As I read on this thread, it’s not possible yet

> [@Test if Viewport is Minimized?](https://forums.unrealengine.com/t/test-if-viewport-is-minimized/317895):
>
> Hello, In my game I control the mouse position to be restricted to the window, if I minimize the game window, the mouse is still restricted to the bounds of the viewport. Is there a way in Blueprint to test if the Viewport is minimized or not? I know there is a function to set the focus to a viewport but I cannot seem to find a node that contains the words “active”, “focus”, “minimized” that achieves this task.

One thing you could do is maybe saving the DateTime in a file (or log) every X seconds or something like that

Another thing I read somewhere else, posted 2 alternatives

> <https://stackoverflow.com/questions/59617067/how-to-make-a-minimized-ue4-application-continue-to-run-in-the-background-or-min>

---

_[View the full topic](https://forums.unrealengine.com/t/is-there-a-way-to-detect-when-the-game-goes-to-background/614990)._
