PageUp / Page Down Home / End in lists

This commit is contained in:
Andrew Pamment 2018-01-20 12:46:50 +10:00
parent 1b4cfc3671
commit 6c3df730aa
4 changed files with 202 additions and 0 deletions

View File

@ -669,6 +669,7 @@ void runbbs_real(int socket, char *ip, int ssh) {
int i; int i;
char iac_echo[] = {255, 251, 1, '\0'}; char iac_echo[] = {255, 251, 1, '\0'};
char iac_sga[] = {255, 251, 3, '\0'}; char iac_sga[] = {255, 251, 3, '\0'};
char iac_binary[] = {255, 251, 0, '\0'};
struct user_record *user; struct user_record *user;
struct tm thetime; struct tm thetime;
struct tm oldtime; struct tm oldtime;
@ -696,6 +697,10 @@ void runbbs_real(int socket, char *ip, int ssh) {
dolog("Failed to send iac_sga"); dolog("Failed to send iac_sga");
exit(0); exit(0);
} }
if (write(socket, iac_binary, 3) != 3) {
dolog("Failed to send iac_binary");
exit(0);
}
} else { } else {
sshBBS = 1; sshBBS = 1;
} }

View File

@ -562,6 +562,41 @@ void list_emails(struct user_record *user) {
} }
s_printf("\e[%d;5H", position - start + 3); s_printf("\e[%d;5H", position - start + 3);
} }
} else if (c == 75) {
// END KEY
position = email_count - 1;
start = email_count - 22;
if (start < 0) {
start = 0;
}
redraw = 1;
} else if (c == 72) {
// HOME KEY
position = 0;
start = 0;
redraw = 1;
} else if (c == 86 || c == '5') {
if (c == '5') {
s_getchar();
}
// PAGE UP
position = position - 22;
if (position < 0) {
position = 0;
}
start = position;
redraw = 1;
} else if (c == 85 || c == '6') {
if (c == '6') {
s_getchar();
}
// PAGE DOWN
position = position + 22;
if (position >= email_count) {
position = email_count -1;
}
start = position;
redraw = 1;
} }
} }
} else if (c == 13) { } else if (c == 13) {

View File

@ -1430,6 +1430,41 @@ void choose_subdir() {
s_printf("\e[%d;5H", selected - start + 2); s_printf("\e[%d;5H", selected - start + 2);
} }
} }
} else if (c == 75) {
// END KEY
selected = list_tmp - 1;
start = list_tmp - 22;
if (start < 0) {
start = 0;
}
redraw = 1;
} else if (c == 72) {
// HOME KEY
selected = 0;
start = 0;
redraw = 1;
} else if (c == 86 || c == '5') {
if (c == '5') {
s_getchar();
}
// PAGE UP
selected = selected - 22;
if (selected < 0) {
selected = 0;
}
start = selected;
redraw = 1;
} else if (c == 85 || c == '6') {
if (c == '6') {
s_getchar();
}
// PAGE DOWN
selected = selected + 22;
if (selected >= list_tmp) {
selected = list_tmp -1;
}
start = selected;
redraw = 1;
} }
} }
} else if (c == 13) { } else if (c == 13) {
@ -1533,6 +1568,41 @@ void choose_directory() {
s_printf("\e[%d;5H", selected - start + 2); s_printf("\e[%d;5H", selected - start + 2);
} }
} }
} else if (c == 75) {
// END KEY
selected = list_tmp - 1;
start = list_tmp - 22;
if (start < 0) {
start = 0;
}
redraw = 1;
} else if (c == 72) {
// HOME KEY
selected = 0;
start = 0;
redraw = 1;
} else if (c == 86 || c == '5') {
if (c == '5') {
s_getchar();
}
// PAGE UP
selected = selected - 22;
if (selected < 0) {
selected = 0;
}
start = selected;
redraw = 1;
} else if (c == 85 || c == '6') {
if (c == '6') {
s_getchar();
}
// PAGE DOWN
selected = selected + 22;
if (selected >= list_tmp) {
selected = list_tmp -1;
}
start = selected;
redraw = 1;
} }
} }
} else if (c == 13) { } else if (c == 13) {

View File

@ -2519,6 +2519,28 @@ void list_messages(struct user_record *user) {
i = 1; i = 1;
start = 0; start = 0;
redraw = 1; redraw = 1;
} else if (c == 86 || c == '5') {
if (c == '5') {
s_getchar();
}
// PAGE UP
i = i - 22;
if (i <= 0) {
i = 1;
}
start = i - 1;
redraw = 1;
} else if (c == 85 || c == '6') {
if (c == '6') {
s_getchar();
}
// PAGE DOWN
i = i + 22;
if (i > msghs->msg_count) {
i = msghs->msg_count;
}
start = i - 1;
redraw = 1;
} }
} }
} else if (c == 13) { } else if (c == 13) {
@ -2643,6 +2665,41 @@ void choose_conference() {
s_printf("\e[%d;5H", selected - start + 2); s_printf("\e[%d;5H", selected - start + 2);
} }
} }
} else if (c == 75) {
// END KEY
selected = list_tmp - 1;
start = list_tmp - 22;
if (start < 0) {
start = 0;
}
redraw = 1;
} else if (c == 72) {
// HOME KEY
selected = 0;
start = 0;
redraw = 1;
} else if (c == 86 || c == '5') {
if (c == '5') {
s_getchar();
}
// PAGE UP
selected = selected - 22;
if (selected < 0) {
selected = 0;
}
start = selected;
redraw = 1;
} else if (c == 85 || c == '6') {
if (c == '6') {
s_getchar();
}
// PAGE DOWN
selected = selected + 22;
if (selected >= list_tmp) {
selected = list_tmp -1;
}
start = selected;
redraw = 1;
} }
} }
} else if (c == 13) { } else if (c == 13) {
@ -2747,6 +2804,41 @@ void choose_area() {
s_printf("\e[%d;5H", selected - start + 2); s_printf("\e[%d;5H", selected - start + 2);
} }
} }
} else if (c == 75) {
// END KEY
selected = list_tmp - 1;
start = list_tmp - 22;
if (start < 0) {
start = 0;
}
redraw = 1;
} else if (c == 72) {
// HOME KEY
selected = 0;
start = 0;
redraw = 1;
} else if (c == 86 || c == '5') {
if (c == '5') {
s_getchar();
}
// PAGE UP
selected = selected - 22;
if (selected < 0) {
selected = 0;
}
start = selected;
redraw = 1;
} else if (c == 85 || c == '6') {
if (c == '6') {
s_getchar();
}
// PAGE DOWN
selected = selected + 22;
if (selected >= list_tmp) {
selected = list_tmp -1;
}
start = selected;
redraw = 1;
} }
} }
} else if (c == 13) { } else if (c == 13) {