1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-12-04 14:46:45 -05:00

Allow a second default key, ";" as well as "=", to help touch-typists!

This commit is contained in:
John Zaitseff 2011-07-21 13:16:42 +10:00
parent ee992fa02a
commit 1408a2ab3d
2 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -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