Fix for movement being stuck if you switch focus when a key is pressed.