Fixed type arrowKeyPress function