add keyPressed check