Fix #12 by setting a flag when the enter key has just been pressed.