From 056c5341d9f8b0498f664cc7fc097ecdef0cc77a Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Sun, 7 May 2006 18:42:35 +0000 Subject: [PATCH] Fixed keyboard deadlock on win32 --- docs/notework.txt | 2 ++ goldlib/gall/gkbdbase.cpp | 25 ++++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/docs/notework.txt b/docs/notework.txt index 878c8c2..b62171e 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,8 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Fixed keyboard deadlock on win32. + + Improved false quote handling. ! Box lines drawing keys was changed from EditGo* to EditBlock*. diff --git a/goldlib/gall/gkbdbase.cpp b/goldlib/gall/gkbdbase.cpp index 54216bd..41cc3f4 100644 --- a/goldlib/gall/gkbdbase.cpp +++ b/goldlib/gall/gkbdbase.cpp @@ -801,7 +801,7 @@ struct kbd { { VK_RETURN, Key_Ent, Key_Ent, Key_C_Ent, Key_A_Ent }, { VK_ESCAPE, Key_Esc, Key_Esc, Key_Esc, Key_A_Esc }, { VK_SPACE, -1, -1, Key_Space, Key_Space }, - { VK_APPS, Key_S_F10, -1, -1, -1 }, + { VK_APPS, Key_S_F10, Key_S_F10, Key_S_F10, -1 }, { '0', Key_0, Key_S_0, -1, Key_A_0 }, { '1', Key_1, Key_S_1, -1, Key_A_1 }, @@ -933,27 +933,30 @@ int gkbd_nt2bios(INPUT_RECORD& inp) { c = k->alt; else if(state & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)) c = k->ctrl; - else if(state & SHIFT_PRESSED) { - if(k->shift == -1) - c = ascii; + else if(state & SHIFT_PRESSED) + { + if (k->shift == -1) + c = ascii ? ascii : -1; else c = k->shift; } else { // If it is a letter key, use the ASCII value supplied // by NT to take into account the CapsLock state. - if(g_isupper(keycode) or (k->normal == -1)) - c = ascii; + if (g_isupper(keycode) or (k->normal == -1)) + c = ascii ? ascii : -1; else c = k->normal; } - if(c != -1) - if(ascii and not (right_alt_same_as_left ? (state & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) : (state & LEFT_ALT_PRESSED))) - if(isalnum(keycode)) + if (c != -1) + { + if (ascii and not (right_alt_same_as_left ? (state & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)) : (state & LEFT_ALT_PRESSED))) + if (isalnum(keycode)) return (ascii == ' ') ? Key_Space : ascii; - if(ISEXT(c)) - return EXTVAL(c) << 8; + if (ISEXT(c)) + return EXTVAL(c) << 8; + } return c; }