Reworked store keypressed event