Added window focus listener to clear keyboard state when window lose focus