# How can I catch alt f4 key in ue5?

**URL:** <https://forums.unrealengine.com/t/how-can-i-catch-alt-f4-key-in-ue5/694624>\
**Category:** International\
**Tags:** unreal-engine, UE5-0, question\
**Created:** [November 19, 2022, 8:46pm UTC](https://forums.unrealengine.com/t/how-can-i-catch-alt-f4-key-in-ue5/694624 "2022-11-19T20:46:10Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![JoostDev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/joostdev/32/88718_2.png) [@JoostDev](https://forums.unrealengine.com/u/JoostDev)\
**Post date:** [August 17, 2023, 8:29am UTC](https://forums.unrealengine.com/t/how-can-i-catch-alt-f4-key-in-ue5/694624/4 "2023-08-17T08:29:25Z")

</div>

According to this post, it can be done:

> [@Catching/Blocking Alt+f4 in Packaged Game](https://forums.unrealengine.com/t/catching-blocking-alt-f4-in-packaged-game/348273/5):
>
> Actually you can also handle window close requests in user code, without ever touching the engine source. The viewport client does have a delegate for exactly that purpose, which can be obtained by the UGameViewportClient::OnWindowCloseRequested() accessor. The world viewport client can be obtained with the UGameInstance::GetGameViewportClient() method, but beware that this is only available after the GameInstance has been initialized, but not yet in the UGameInstance::Init() method. So, as c…

---

_[View the full topic](https://forums.unrealengine.com/t/how-can-i-catch-alt-f4-key-in-ue5/694624)._
