The ENTER key is not a space, but it is a character, therefore the default path in the switch is taken and the program exits.