Reset keystate when unfocusing and focusing window