method keyPressed added