fix "key pressed" bug