Respond to esc events to close the dialog and enter events to trigger success callback