Alt tab breaks various input checks

After alt+tabbing, various input checks such as “Any key pressed” “Mouse click” etc do not work properly, the game continues thinking a key is stuck pressed down or the mouse is stuck clicked. Spamming the “Alt” key a few times, or tabbing in and out can sometimes fix it, other times it will be broken until restarting. Inconsistent behavior.