From b3e19726220b0bd472a172a28275f2c970b75868 Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Thu, 11 May 2023 01:30:03 +0900 Subject: [PATCH] update --- src/Home/Telnet/Telnet.ZC | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/Home/Telnet/Telnet.ZC b/src/Home/Telnet/Telnet.ZC index 8eebbb92..41c49afd 100755 --- a/src/Home/Telnet/Telnet.ZC +++ b/src/Home/Telnet/Telnet.ZC @@ -105,7 +105,6 @@ U0 InputTask(U0 *args) { // https://theasciicode.com.ar/ascii-control-characters/escape-ascii-code-27.html input_len = 0; while (1) { - // Bool shift_pressed = FALSE; U8 key = KeyGet(&sc); switch (key) { @@ -134,22 +133,16 @@ U0 InputTask(U0 *args) { case SC_TAB: TCPSocketSendString(sock, 0x09); break; - // case 0x2A: // Shift - // shift_pressed = TRUE; - // break; - // case 0x01: // Escape - // if (shift_pressed) { - // // Handle Shift + Escape - // force_disconnect = TRUE; - // shift_pressed = FALSE; - // } else { - // // Handle regular Escape - // } - // break; - default: - break; + default: + break; } break; + + case CH_SHIFT_ESC: + force_disconnect = TRUE; + TCPSocketClose(sock); + "Telnet connection closed.\n"; + break; // send buffer on enter case '\n': SysLog(input_buffer); @@ -160,8 +153,9 @@ U0 InputTask(U0 *args) { Free(temp); MemSet(input_buffer, 0, BUF_SIZE); DocClear; - break; - case 3: // CTRL+C + + DocBottom(input_task->put_doc); + "\n$$RED$$$BK,1$Input$BK,0$$$BLACK$$:"; break; default: if (key >= ' ' && key <= '~') { @@ -184,11 +178,11 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) { I64 window_height = 25; I64 window_left = (GR_WIDTH - window_width) / 2; - I64 window_top = (Fs->win_bottom - Fs->win_top - window_height) / 2; + I64 window_top = (Fs->win_bottom - Fs->win_top - window_height+1) / 2; // DocPrint(, "$$WW,1$$"); 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+1, Fs); // DocCursor(OFF); // WinToTop(Fs); @@ -399,7 +393,8 @@ U0 Telnet(U8 *host, U16 port=TELNET_PORT) { col = window_width-1; // SysLog("H or f AFTER row:%d, col:%d, cnt:%d\n", row, col, ansi_param_count); - "$$CM,%d,%d$$", row, col; + // "$$CM,%d,%d$$", row, col; + "$$CM,LE=%d,RE=%d$$", row, col; ptr++; break; case 'J':