modify key state to control player moving