From 1408a2ab3d3c2927f4bf5b0e99efdff01268a83f Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Thu, 21 Jul 2011 13:16:42 +1000 Subject: [PATCH] Allow a second default key, ";" as well as "=", to help touch-typists! --- src/intf.c | 4 ++-- src/intf.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/intf.c b/src/intf.c index 1fa1874..1a7de06 100644 --- a/src/intf.c +++ b/src/intf.c @@ -552,8 +552,8 @@ int gettxline (WINDOW *win, char *buf, int bufsize, bool multifield, if (key == ERR) { // Do nothing on ERR ; - } else if ((key == KEY_DEFAULTVAL) && (defaultval != NULL) - && (len == 0)) { + } else if ((key == KEY_DEFAULTVAL1 || key == KEY_DEFAULTVAL2) + && defaultval != NULL && len == 0) { // Initialise buffer with the default value strncpy(buf, defaultval, bufsize - 1); diff --git a/src/intf.h b/src/intf.h index 86e0038..4e1f385 100644 --- a/src/intf.h +++ b/src/intf.h @@ -79,8 +79,9 @@ typedef enum curs_type { #define KEY_ILLEGAL 077777 // No key should ever return this! -// Keycode for inserting the default value in input routines -#define KEY_DEFAULTVAL '=' +// Keycodes for inserting the default value in input routines +#define KEY_DEFAULTVAL1 '=' +#define KEY_DEFAULTVAL2 ';' // Control-arrow key combinations, as returned by NCurses #ifndef KEY_CDOWN