Added keyboard input and fixed an issue where the game could not be closed