Issue with alt key modifier state in the SlateApplication when alt-tabbing in full screen mode

I’m having issues with alt-tab behavior in a packaged shipping build with UE 5.5 where roughly 10%-20% of the time the “alt” key is detected as still being held down after the user alt tabs back into the game. In that case, if the player hits enter it is treated as “alt-enter” and thus resizes the game window which is very frustrating for my players.

Logging verifies that the alt key state is incorrect when the GetModifierKeysState function in FSlateApplication.cpp is called after the window regains focus. The alt key is marked as still down even though the key on the users keyboard is up. As far as I can tell there is no direct way to overwrite the state of the Modifier Keys Array in SlateApplication.cpp.

This issue never occurs if the player is in borderless mode rather than in fullscreen mode.

Does anyone know a solution or workaround to this problem?

In case it helps anyone in the future the unfortunately hacky solution I came up with is to check if the alt key modifier is down after the window regains focus and to use the windows.h api so send an alt-up event in that case.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.