| 38 |
|
|
| 39 |
#define STR_TOP_LEFT_MAX_LEN 80 |
#define STR_TOP_LEFT_MAX_LEN 80 |
| 40 |
#define STR_TOP_MIDDLE_MAX_LEN 40 |
#define STR_TOP_MIDDLE_MAX_LEN 40 |
| 41 |
#define STR_TOP_RIGHT_MAX_LEN 40 |
#define STR_TOP_RIGHT_MAX_LEN 80 |
| 42 |
|
|
| 43 |
static const char *get_time_str(char *s, size_t len) |
static const char *get_time_str(char *s, size_t len) |
| 44 |
{ |
{ |
| 118 |
if (echo) |
if (echo) |
| 119 |
{ |
{ |
| 120 |
outc('\x83'); // ASCII code 131 |
outc('\x83'); // ASCII code 131 |
|
iflush(); |
|
| 121 |
} |
} |
| 122 |
else |
else |
| 123 |
{ |
{ |
| 124 |
// outc ('\x85'); // ASCII code 133 |
// outc ('\x85'); // ASCII code 133 |
| 125 |
prints("\xff\xfb\x01\xff\xfb\x03"); |
prints("\xff\xfb\x01\xff\xfb\x03"); |
|
iflush(); |
|
|
igetch(0); |
|
|
igetch_reset(); |
|
| 126 |
} |
} |
| 127 |
|
iflush(); |
| 128 |
} |
} |
| 129 |
|
|
| 130 |
static int _str_input(char *buffer, int buf_size, int max_display_len, int echo_mode) |
static int _str_input(char *buffer, int buf_size, int max_display_len, int echo_mode) |
| 148 |
|
|
| 149 |
if (ch == CR) |
if (ch == CR) |
| 150 |
{ |
{ |
|
igetch_reset(); |
|
| 151 |
break; |
break; |
| 152 |
} |
} |
| 153 |
else if (ch == KEY_TIMEOUT || ch == KEY_NULL) // timeout or broken pipe |
else if (ch == KEY_TIMEOUT || ch == KEY_NULL) // timeout or broken pipe |
| 318 |
|
|
| 319 |
if (ch == CR) |
if (ch == CR) |
| 320 |
{ |
{ |
|
igetch_reset(); |
|
| 321 |
break; |
break; |
| 322 |
} |
} |
| 323 |
else if (ch == KEY_TIMEOUT || ch == KEY_NULL) // timeout or broken pipe |
else if (ch == KEY_TIMEOUT || ch == KEY_NULL) // timeout or broken pipe |
| 648 |
ch = igetch_t(MAX_DELAY_TIME); |
ch = igetch_t(MAX_DELAY_TIME); |
| 649 |
input_ok = 1; |
input_ok = 1; |
| 650 |
|
|
| 651 |
|
if (ch != KEY_NULL && ch != KEY_TIMEOUT) |
| 652 |
|
{ |
| 653 |
|
BBS_last_access_tm = time(NULL); |
| 654 |
|
} |
| 655 |
|
|
| 656 |
// extended key handler |
// extended key handler |
| 657 |
if (key_handler(&ch, &ctx) != 0) |
if (key_handler(&ch, &ctx) != 0) |
| 658 |
{ |
{ |
| 662 |
switch (ch) |
switch (ch) |
| 663 |
{ |
{ |
| 664 |
case KEY_NULL: |
case KEY_NULL: |
| 665 |
|
log_error("KEY_NULL\n"); |
| 666 |
|
goto cleanup; |
| 667 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 668 |
|
log_error("User input timeout\n"); |
| 669 |
goto cleanup; |
goto cleanup; |
| 670 |
case KEY_HOME: |
case KEY_HOME: |
| 671 |
if (line_current - output_current_row < 0) // Reach begin |
if (line_current - output_current_row < 0) // Reach begin |
| 699 |
output_end_row = SCREEN_ROWS - 1; // Legacy Fterm only works with this line |
output_end_row = SCREEN_ROWS - 1; // Legacy Fterm only works with this line |
| 700 |
break; |
break; |
| 701 |
case CR: |
case CR: |
|
igetch_reset(); |
|
| 702 |
case KEY_SPACE: |
case KEY_SPACE: |
| 703 |
case KEY_DOWN: |
case KEY_DOWN: |
| 704 |
if (line_current + (screen_row_total - (output_current_row - screen_begin_row)) >= display_line_total) // Reach end |
if (line_current + (screen_row_total - (output_current_row - screen_begin_row)) >= display_line_total) // Reach end |
| 767 |
input_ok = 0; |
input_ok = 0; |
| 768 |
break; |
break; |
| 769 |
} |
} |
|
|
|
|
BBS_last_access_tm = time(NULL); |
|
| 770 |
} |
} |
| 771 |
|
|
| 772 |
continue; |
continue; |