Move key code to keypressed