| 3 |
* io |
* io |
| 4 |
* - basic terminal-based user input / output features |
* - basic terminal-based user input / output features |
| 5 |
* |
* |
| 6 |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2026 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
| 590 |
#ifdef _DEBUG |
#ifdef _DEBUG |
| 591 |
for (int j = stdin_buf_offset; j < stdin_buf_len; j++) |
for (int j = stdin_buf_offset; j < stdin_buf_len; j++) |
| 592 |
{ |
{ |
| 593 |
log_debug("input: <--[%u]", (stdin_buf[j] + 256) % 256); |
log_debug("input: <--[%u]", (unsigned char)(stdin_buf[j])); |
| 594 |
} |
} |
| 595 |
#endif |
#endif |
| 596 |
} |
} |
| 608 |
#ifdef _DEBUG |
#ifdef _DEBUG |
| 609 |
for (int j = stdin_conv_offset; j < stdin_conv_len; j++) |
for (int j = stdin_conv_offset; j < stdin_conv_len; j++) |
| 610 |
{ |
{ |
| 611 |
log_debug("input_conv: <--[%u]", (stdin_conv[j] + 256) % 256); |
log_debug("input_conv: <--[%u]", (unsigned char)(stdin_conv[j])); |
| 612 |
} |
} |
| 613 |
#endif |
#endif |
| 614 |
} |
} |
| 1060 |
continue; |
continue; |
| 1061 |
} |
} |
| 1062 |
|
|
| 1063 |
out = ((int)c + 256) % 256; |
out = c; |
| 1064 |
break; |
break; |
| 1065 |
} |
} |
| 1066 |
|
|
| 1070 |
out = KEY_ESC; |
out = KEY_ESC; |
| 1071 |
} |
} |
| 1072 |
|
|
| 1073 |
|
// KEY_BACKSPACE -> BACKSPACE |
| 1074 |
|
if (out == KEY_BACKSPACE) |
| 1075 |
|
{ |
| 1076 |
|
out = BACKSPACE; |
| 1077 |
|
} |
| 1078 |
|
|
| 1079 |
// for debug |
// for debug |
| 1080 |
#ifdef _DEBUG |
#ifdef _DEBUG |
| 1081 |
if (out != KEY_TIMEOUT && out != KEY_NULL) |
if (out != KEY_TIMEOUT && out != KEY_NULL) |