fix key on/off detect.