How can I catch alt f4 key in ue5?

Help

I believe it is a universal windows key combination and can’t be catches unless you override the default behaviour for the WM_CLOSE message. This will require C++.

or

According to this post, it can be done:

alt+f4 never reaches the input system as a key, windows turns it into a WM_CLOSE message so no key binding can catch it. the engine hook is UGameViewportClient::OnWindowCloseRequested, bind it after the game instance is up and return false and the close is ignored. that only covers a graceful close though, a kill from task manager or a crash never passes through that delegate. you can also try Kiosk Lockdown Toolkit, a kiosk mode plugin for Unreal Engine that swallows alt+f4 at the OS layer before it ever becomes a close request: Kiosk Lockdown Toolkit — Block Alt+Tab, Win Key & Taskbar for Kiosks | Fab