keystate -> state