Added key codes and a stop moving function