From the user:
The root of the problem appears to be that KeyState.EventAccumulator still has events stored in the structure for 'LeftAlt'. So, although UPlayerInput::FlushInput is called when the window loses focus - and resets the bDown and bDownPrevious values, it doesn't clear EventAccumulator, which will subsequently process and result in the 'LeftAlt' key being marked as still held down.
For reference, here is the code for resetting the KeyState in UPlayerInput::FlushInput
for (TMap<FKey,FKeyState>::TIterator It(KeyStateMap); It; ++It)
Unknown macro: { FKey& Key = It.Key(); FKeyState& KeyState = It.Value(); KeyState.RawValue = FVector(0.f, 0.f, 0.f); KeyState.bDown = false; KeyState.bDownPrevious = false; KeyState.LastUpDownTransitionTime = TimeSeconds; }
As a test, I tried clearing the KeyState's event accumulator
Unknown macro: { ... KeyState.RawValue = FVector(0.f, 0.f, 0.f); KeyState.bDown = false; KeyState.bDownPrevious = false; KeyState.LastUpDownTransitionTime = TimeSeconds; *KeyState.EventAccumulator->Reset();* }
which solves the issue, but I'm unsure of other knock on effects. I also tried calling DiscardPlayerInput(); at the end of FlushPlayerInput() and that also solved the issue.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-205014 in the post.