From eeef7163c8753db933444accba0488f3e2d1b1e1 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 14 May 2013 11:36:00 +0800 Subject: [PATCH] Applications/GUI Terminal - Fixed sticky Ctrl/Alt keys, reduced flush rate --- Usermode/Applications/gui_shell_src/display.c | 5 +---- Usermode/Applications/gui_shell_src/main.c | 9 +++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Usermode/Applications/gui_shell_src/display.c b/Usermode/Applications/gui_shell_src/display.c index 1665e448..bb07e39f 100644 --- a/Usermode/Applications/gui_shell_src/display.c +++ b/Usermode/Applications/gui_shell_src/display.c @@ -88,7 +88,6 @@ void Display_AddText(int Length, const char *UTF8Text) Display_int_PushString(bytes, UTF8Text); UTF8Text += bytes; - _SysDebug("Length(%i) -= bytes(%i)", Length, bytes); Length -= bytes; if( Length != 0 ) { @@ -102,7 +101,7 @@ void Display_AddText(int Length, const char *UTF8Text) void Display_Newline(int bCarriageReturn) { - Display_Flush(); +// Display_Flush(); // Going down! giCurrentLine ++; @@ -238,8 +237,6 @@ void Display_Flush(void) AxWin3_RichText_SendLine(gMainWindow, giFirstLine + i, gasDisplayLines[line] ); gabDisplayLinesDirty[line] = 0; } - - // force redraw? AxWin3_RichText_SetCursorPos(gMainWindow, giCurrentLine, giCurrentCol); } diff --git a/Usermode/Applications/gui_shell_src/main.c b/Usermode/Applications/gui_shell_src/main.c index 4b82d0e0..ec88bf32 100644 --- a/Usermode/Applications/gui_shell_src/main.c +++ b/Usermode/Applications/gui_shell_src/main.c @@ -96,7 +96,7 @@ int main(int argc, char *argv[], const char **envp) { _SysDebug("Activity on child stdout"); // Read and update screen - char buf[32]; + char buf[128]; int len = _SysRead(giChildStdout, buf, sizeof(buf)); if( len <= 0 ) break; @@ -112,7 +112,7 @@ int Term_KeyHandler(tHWND Window, int bPress, uint32_t KeySym, uint32_t Translat static int ctrl_state = 0; // Handle modifiers - #define _bitset(var,bit,set) do{if(set)var|=1<<(bit);else var&=1<<(bit);}while(0) + #define _bitset(var,bit,set) do{if(set)var|=1<<(bit);else var&=~(1<<(bit));}while(0) switch(KeySym) { case KEYSYM_LEFTCTRL: @@ -129,6 +129,7 @@ int Term_KeyHandler(tHWND Window, int bPress, uint32_t KeySym, uint32_t Translat if( ctrl_state && KeySym >= KEYSYM_a && KeySym <= KEYSYM_z ) { Translated = KeySym - KEYSYM_a + 1; + _SysDebug("Ctrl-%c: KS %x => Trans %x", 'A'+(KeySym-KEYSYM_a), KeySym, Translated); } // == 2 :: FIRE @@ -142,7 +143,7 @@ int Term_KeyHandler(tHWND Window, int bPress, uint32_t KeySym, uint32_t Translat // Encode and send len = WriteUTF8(buf, Translated); - _SysDebug("Keystroke translated to '%.*s'", len, buf); + _SysDebug("Keystroke %x:%x translated to '%.*s'", KeySym, Translated, len, buf); _SysWrite(giChildStdin, buf, len); return 0; @@ -184,7 +185,7 @@ void Term_HandleOutput(int Len, const char *Buf) esc_len = -esc_len; } ofs += esc_len; - _SysDebug("Len = %i, ofs = %i", Len, ofs); + //_SysDebug("Len = %i, ofs = %i", Len, ofs); } Display_Flush(); -- 2.20.1