Experimental patch to use Rubout as Backspace

This commit is contained in:
Michiel Broek 2002-09-27 17:58:24 +00:00
parent 7a26f2d5eb
commit daa714effd
4 changed files with 158 additions and 150 deletions

View File

@ -116,6 +116,10 @@ v0.35.03 06-Jul-2002
FTP server side). FTP server side).
Added setup setting for outbound queue in global setup. Added setup setting for outbound queue in global setup.
Added support for default setup of the HA archiver. Added support for default setup of the HA archiver.
Changed Rubout key to do the same as Backspace. (experimental)
mbmon:
Changed Rubout key to do the same as Backspace. (experimental)
script: script:
The bbsdoor.sh and rundoor.sh scripts are now only installed The bbsdoor.sh and rundoor.sh scripts are now only installed

1
TODO
View File

@ -167,4 +167,5 @@ mbsetup:
N: Add areas security flags. N: Add areas security flags.
N: Add backspace test and store result in global setup. N: Add backspace test and store result in global setup.
Note: experimental patch to test Rubout key as backspace.

View File

@ -252,6 +252,7 @@ char *edit_field(int y, int x, int w, int p, char *s_)
newinsert(1, YELLOW, BLUE); newinsert(1, YELLOW, BLUE);
break; break;
case KEY_BACKSPACE: case KEY_BACKSPACE:
case KEY_RUBOUT:
if (strlen(s) > 0) { if (strlen(s) > 0) {
if (curpos >= strlen(s)) { if (curpos >= strlen(s)) {
curpos--; curpos--;
@ -264,7 +265,6 @@ char *edit_field(int y, int x, int w, int p, char *s_)
} else } else
putchar(7); putchar(7);
break; break;
case KEY_RUBOUT:
case KEY_DEL: case KEY_DEL:
if (strlen(s) > 0) { if (strlen(s) > 0) {
if ((curpos) == (strlen(s) -1)) { if ((curpos) == (strlen(s) -1)) {

View File

@ -206,8 +206,7 @@ char *edit_field(int y, int x, int w, int p, char *s_)
charok = 1; charok = 1;
break; break;
case '9': case '9':
if (ch == ' ' || ch == '-' || ch == ',' || if (ch == ' ' || ch == '-' || ch == ',' || ch == '.' || isdigit(ch))
ch == '.' || isdigit(ch))
charok = 1; charok = 1;
break; break;
case 'U': case 'U':
@ -221,10 +220,9 @@ char *edit_field(int y, int x, int w, int p, char *s_)
} }
} }
} while (charok == 0 && ch != KEY_ENTER && ch != KEY_LINEFEED && } while (charok == 0 && ch != KEY_ENTER && ch != KEY_LINEFEED && ch != KEY_DEL &&
ch != KEY_DEL && ch != KEY_INS && ch != KEY_HOME && ch != KEY_INS && ch != KEY_HOME && ch != KEY_LEFT && ch != KEY_RIGHT &&
ch != KEY_LEFT && ch != KEY_RIGHT && ch != KEY_ESCAPE && ch != KEY_ESCAPE && ch != KEY_BACKSPACE && ch != KEY_RUBOUT && ch != KEY_END);
ch != KEY_BACKSPACE && ch != KEY_RUBOUT && ch != KEY_END);
if (charok == 1) { if (charok == 1) {
@ -292,6 +290,11 @@ char *edit_field(int y, int x, int w, int p, char *s_)
newinsert(1, YELLOW, BLUE); newinsert(1, YELLOW, BLUE);
break; break;
case KEY_BACKSPACE: case KEY_BACKSPACE:
case KEY_RUBOUT:
if (ch == KEY_RUBOUT)
Syslog('-', "Rubout pressed");
else
Syslog('-', "Backspace pressed");
if (strlen(s) > 0) { if (strlen(s) > 0) {
if (curpos >= strlen(s)) { if (curpos >= strlen(s)) {
curpos--; curpos--;
@ -304,8 +307,8 @@ char *edit_field(int y, int x, int w, int p, char *s_)
} else } else
putchar(7); putchar(7);
break; break;
case KEY_RUBOUT:
case KEY_DEL: case KEY_DEL:
Syslog('-', "Delete key pressed");
if (strlen(s) > 0) { if (strlen(s) > 0) {
if ((curpos) == (strlen(s) -1)) { if ((curpos) == (strlen(s) -1)) {
s[curpos] = '\0'; s[curpos] = '\0';