A quick look at flush input: what is it and why would you want to use it. It essentially clears the last input before you go into UI mode only.
https://dev.epicgames.com/community/learning/tutorials/5JYw/unreal-engine-what-is-flush-input-and-why-you-might-want-to-enable-it