This commit is contained in:
y4my4my4m 2023-05-09 01:35:03 +09:00
parent 631712d3f3
commit 889288c65f

View file

@ -150,6 +150,7 @@ U0 InputTask(U0 *args) {
DocTermNew; DocTermNew;
DocPrint(, "$$WW,1$$"); DocPrint(, "$$WW,1$$");
DocCursor;
U8 input_buffer[BUF_SIZE]; U8 input_buffer[BUF_SIZE];
U8 *temp, ch; U8 *temp, ch;
@ -162,6 +163,7 @@ U0 InputTask(U0 *args) {
DocBottom(input_task->put_doc); DocBottom(input_task->put_doc);
"\n$$RED$$$BK,1$Input$BK,0$$$BLACK$$:"; "\n$$RED$$$BK,1$Input$BK,0$$$BLACK$$:";
// https://theasciicode.com.ar/ascii-control-characters/escape-ascii-code-27.html
input_len = 0; input_len = 0;
while (1) { while (1) {
ch = CharGet(, FALSE); ch = CharGet(, FALSE);
@ -175,7 +177,15 @@ U0 InputTask(U0 *args) {
break; break;
} }
else if (ch == CH_ESC) { else if (ch == CH_ESC) {
input_buffer[input_len++] = 0x1B; TCPSocketSendString(sock, 0x27);
break;
}
// else if (ch == CH_BACKSPACE) {
// TCPSocketSendString(sock, 0x08);
// break;
// }
else if (ch == 0x0F) { // TAB?
TCPSocketSendString(sock, 0x09);
break; break;
} }
else { else {
@ -185,7 +195,7 @@ U0 InputTask(U0 *args) {
DocPrint(input_task->put_doc, "%c", ch); DocPrint(input_task->put_doc, "%c", ch);
} }
} }
input_buffer[input_len++] = '\0'; // input_buffer[input_len++] = '\0';
if (!force_disconnect) { if (!force_disconnect) {
SysLog(input_buffer); SysLog(input_buffer);
@ -218,8 +228,9 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
WinHorz(Fs->win_left, Fs->win_left+window_width, Fs); WinHorz(Fs->win_left, Fs->win_left+window_width, Fs);
WinVert(Fs->win_top + window_top, Fs->win_top + window_top + window_height, Fs); WinVert(Fs->win_top + window_top, Fs->win_top + window_top + window_height, Fs);
WinToTop(Fs); DocCursor(OFF);
WinFocus(Fs); // WinToTop(Fs);
// WinFocus(Fs);
sock = TelnetOpen(host, port); sock = TelnetOpen(host, port);
if (sock <= 0) { if (sock <= 0) {
@ -332,7 +343,7 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) {
// Respond with cursor position // Respond with cursor position
// U8 response[32] = "\x1B[%d;%dR", window_width, window_height; // U8 response[32] = "\x1B[%d;%dR", window_width, window_height;
SysLog("reported cursor position\n"); SysLog("reported cursor position\n");
TCPSocketSendString(sock, "\x1B[25;80R"); TCPSocketSendString(sock, "\x1B\[25;80R");
} }
ptr++; ptr++;
} else if (*ptr == 'c') { } else if (*ptr == 'c') {
@ -529,7 +540,7 @@ U0 TelnetPrompt() {
// Telnet("TextMMOde.com"); // Sands of Time / Deep Space MMO // Telnet("TextMMOde.com"); // Sands of Time / Deep Space MMO
// Telnet("legendofthereddragon.ca"); // Legend of the Red Dragon (Canada) // Telnet("legendofthereddragon.ca"); // Legend of the Red Dragon (Canada)
// Telnet("lord.stabs.org"); // Legend of the Red Dragon // Telnet("lord.stabs.org"); // Legend of the Red Dragon
Telnet("thehatshop.mudhosting.net", 3000); // Hallowed Halls // Telnet("thehatshop.mudhosting.net", 3000); // Hallowed Halls
// Telnet("batmud.bat.org"); // BatMUD // Telnet("batmud.bat.org"); // BatMUD
// Telnet("forgottenkingdoms.org", 4000); // Forgotten Kingdoms // Telnet("forgottenkingdoms.org", 4000); // Forgotten Kingdoms
// Telnet("igormud.org", 1701);// Igor MUD // Telnet("igormud.org", 1701);// Igor MUD
@ -537,5 +548,7 @@ Telnet("thehatshop.mudhosting.net", 3000); // Hallowed Halls
// Telnet("gcomm.com"); // Galacticomm BBS // Telnet("gcomm.com"); // Galacticomm BBS
// Telnet("1984.ws"); // 1984 // Telnet("1984.ws"); // 1984
Telnet("telnet.holdfastbbs.ca", 2323);
// ZealBBS dev server // ZealBBS dev server
// Telnet("localhost", 8888); // Telnet("localhost", 8888);