# Disabling system keys (alt+f4 - alt+tab)

**URL:** <https://forums.unrealengine.com/t/disabling-system-keys-alt-f4-alt-tab/465375>\
**Category:** Platform & Builds\
**Tags:** disable, unreal-engine, question\
**Created:** [May 18, 2020, 5:36am UTC](https://forums.unrealengine.com/t/disabling-system-keys-alt-f4-alt-tab/465375 "2020-05-18T05:36:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alverspin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alverspin](https://forums.unrealengine.com/u/Alverspin)\
**Post date:** [May 18, 2020, 5:36am UTC](https://forums.unrealengine.com/t/disabling-system-keys-alt-f4-alt-tab/465375/1 "2020-05-18T05:36:44Z")

</div>

Hi! I’m trying to make a very inmersive game, with a main character that talks with the player. The character is terrified with the possibility that player closes the game. By this reason I want to control how the player closes the game itself, disabling keybindings like alt+f4 to close the game or alt+tab to change window. It can be sound like something malicious but is only a game design decission that I would like to implement if it is possible. Do you know any option to disabling this system keys? In blueprints if it’s possible. Or maybe in console? Thanks!

---

<div class="post-metadata">

**Author:** ![Blackforcedragon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blackforcedragon/32/1010299_2.png) [@Blackforcedragon](https://forums.unrealengine.com/u/Blackforcedragon)\
**Post date:** [May 19, 2020, 4:51pm UTC](https://forums.unrealengine.com/t/disabling-system-keys-alt-f4-alt-tab/465375/2 "2020-05-19T16:51:48Z")

</div>

You can’t disable Alt+F4 and Alt + Tab as they are a part of Windows.

If your game freezes or crashes, then you need a way to force quit the game without needing to your task manager and close Windows

---

<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:27am UTC](https://forums.unrealengine.com/t/disabling-system-keys-alt-f4-alt-tab/465375/3 "2023-08-17T08:27:32Z")

</div>

(Old thread, adding a reply anyway in case anyone else runs into this thread.)

For Alt+F4 this post explains how to disable it, so apparently that’s actually possible:

> [@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…

---

<div class="post-metadata">

**Author:** ![ShadowBr0kerz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shadowbr0kerz/32/1201558_2.png) [@ShadowBr0kerz](https://forums.unrealengine.com/u/ShadowBr0kerz)\
**Post date:** [October 16, 2026, 5:56pm UTC](https://forums.unrealengine.com/t/disabling-system-keys-alt-f4-alt-tab/465375/4 "2026-10-16T17:56:36Z")

</div>

for system keys like alt+tab and the windows key, unreal input will never see them. windows eats those combos before they reach the game window, so no input mapping or UI focus trick can catch them. the only thing that works is a low level keyboard hook that swallows the keystroke at the OS layer.

for alt+f4 specifically you get a window close request instead of a key event, so bind UGameViewportClient::OnWindowCloseRequested if you want a clean exit path in C++.

if you want to lock down a packaged UE5 game on a public screen without writing that hook yourself, Kiosk Lockdown Toolkit is a kiosk mode plugin for Unreal Engine 5 that does the keyboard filtering, win keys, alt+tab, alt+esc, alt+f4 and the task manager shortcut, each switchable: [Kiosk Lockdown Toolkit — Block Alt+Tab, Win Key & Taskbar for Kiosks | Fab](https://www.fab.com/listings/c91c6583-6eea-412b-ae64-248ddd69f731)

one honest limit: ctrl+alt+del is handled by windows itself and no application can block it, so pair it with a windows policy if that combo has to be closed too.
