add method keypressed