| 88 |
void clearscr() |
void clearscr() |
| 89 |
{ |
{ |
| 90 |
prints("\033[2J"); |
prints("\033[2J"); |
| 91 |
moveto(0, 0); |
moveto(1, 1); |
| 92 |
} |
} |
| 93 |
|
|
| 94 |
inline int press_any_key() |
inline int press_any_key() |
| 209 |
ch = igetch(100); // 0.1 second |
ch = igetch(100); // 0.1 second |
| 210 |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
| 211 |
{ |
{ |
| 212 |
#ifdef _DEBUG |
log_debug("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
log_error("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
|
#endif |
|
| 213 |
str_len = 0; |
str_len = 0; |
| 214 |
break; |
break; |
| 215 |
} |
} |
| 531 |
ch = igetch(100); // 0.1 second |
ch = igetch(100); // 0.1 second |
| 532 |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
| 533 |
{ |
{ |
| 534 |
#ifdef _DEBUG |
log_debug("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
log_error("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
|
#endif |
|
| 535 |
str_len = 0; |
str_len = 0; |
| 536 |
break; |
break; |
| 537 |
} |
} |
| 716 |
switch (ch) |
switch (ch) |
| 717 |
{ |
{ |
| 718 |
case KEY_NULL: |
case KEY_NULL: |
| 719 |
log_error("KEY_NULL\n"); |
log_debug("KEY_NULL\n"); |
| 720 |
goto cleanup; |
goto cleanup; |
| 721 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 722 |
log_error("User input timeout\n"); |
log_debug("User input timeout\n"); |
| 723 |
goto cleanup; |
goto cleanup; |
| 724 |
case KEY_HOME: |
case KEY_HOME: |
| 725 |
if (line_current - output_current_row < 0) // Reach begin |
if (line_current - output_current_row < 0) // Reach begin |