Swallow Escaped Input on menus... like arrow keys.

This commit is contained in:
Andrew Pamment 2016-12-02 15:31:29 +10:00
parent 7340e7c254
commit e61d46ddfe
6 changed files with 46 additions and 0 deletions

6
bbs.c
View File

@ -276,6 +276,12 @@ void s_readstring(char *buffer, int max) {
} else if (c == '\b' || c == 127) { } else if (c == '\b' || c == 127) {
i -= 1; i -= 1;
continue; continue;
} else if (c == 27) {
c = s_getchar();
if (c == 91) {
c = s_getchar();
}
continue;
} }
if (c == '\n' || c == '\r') { if (c == '\n' || c == '\r') {

View File

@ -207,6 +207,14 @@ void bbs_list(struct user_record *user) {
c = s_getc(); c = s_getc();
switch(tolower(c)) { switch(tolower(c)) {
case 27:
{
c = s_getc();
if (c == 91) {
c = s_getc();
}
}
break;
case 'l': case 'l':
list_bbses(); list_bbses();
break; break;

View File

@ -714,6 +714,14 @@ int file_menu(struct user_record *user) {
c = lRet[0]; c = lRet[0];
} }
switch(tolower(c)) { switch(tolower(c)) {
case 27:
{
c = s_getc();
if (c == 91) {
c = s_getc();
}
}
break;
case 'i': case 'i':
{ {
s_printf(get_string(77)); s_printf(get_string(77));

View File

@ -1347,6 +1347,14 @@ int mail_menu(struct user_record *user) {
c = lRet[0]; c = lRet[0];
} }
switch(tolower(c)) { switch(tolower(c)) {
case 27:
{
c = s_getc();
if (c == 91) {
c = s_getc();
}
}
break;
case '!': case '!':
{ {
mail_scan(user); mail_scan(user);

View File

@ -65,6 +65,14 @@ void main_menu(struct user_record *user) {
} }
switch(tolower(c)) { switch(tolower(c)) {
case 27:
{
c = s_getc();
if (c == 91) {
c = s_getc();
}
}
break;
case 'o': case 'o':
{ {
automessage_write(user); automessage_write(user);

View File

@ -21,6 +21,14 @@ void settings_menu(struct user_record *user) {
c = s_getc(); c = s_getc();
switch(tolower(c)) { switch(tolower(c)) {
case 27:
{
c = s_getc();
if (c == 91) {
c = s_getc();
}
}
break;
case 'p': case 'p':
{ {
s_printf(get_string(155)); s_printf(get_string(155));