Fix logic for key tapped and pressed.