As time has passed, it may not be necessary anymore …
When focus lost UGameViewportClient :: LostFocus() is called.
At that time, APlayerController :: FlushPressedKeys () called and the inputs are erased.
You can do by overrideing function so that it does not clear the key.