Handle loss of keyboard focus as well as mouse