From e263bd42e43ddc93f213c8ae9e5ea24397ca8c7f Mon Sep 17 00:00:00 2001 From: ewt Date: Mon, 17 Jun 1996 15:16:10 +0000 Subject: [PATCH] added NEWT_ENTRY_RETURNEXIT --- entry.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/entry.c b/entry.c index 1341d1b..aebea4c 100644 --- a/entry.c +++ b/entry.c @@ -85,6 +85,7 @@ newtComponent newtEntry(int left, int top, char * initialValue, int width, if (initialValue) { strcpy(en->buf, initialValue); en->bufUsed = strlen(initialValue); + en->cursorPosition = en->bufUsed; } return co; @@ -189,6 +190,12 @@ static struct eventResult entryHandleKey(struct newtComponent * co, int key) { er.result = ER_SWALLOWED; switch (key) { + case '\r': /* Return */ + if (en->flags & NEWT_ENTRY_RETURNEXIT) { + er.result = ER_EXITFORM; + } + break; + case '\001': /* ^A */ case NEWT_KEY_HOME: en->cursorPosition = 0; -- 2.47.2