reset input state when window loses focus