Speed up input by moving enter & escape actions to keypress.