Add function to handle keypress and move player