Fixed keyboard deadlock on win32

This commit is contained in:
Ianos Gnatiuc 2006-05-07 18:42:35 +00:00
parent 72a3864d91
commit 056c5341d9
2 changed files with 16 additions and 11 deletions

View File

@ -10,6 +10,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
- Fixed keyboard deadlock on win32.
+ Improved false quote handling. + Improved false quote handling.
! Box lines drawing keys was changed from EditGo* to EditBlock*. ! Box lines drawing keys was changed from EditGo* to EditBlock*.

View File

@ -801,7 +801,7 @@ struct kbd {
{ VK_RETURN, Key_Ent, Key_Ent, Key_C_Ent, Key_A_Ent }, { VK_RETURN, Key_Ent, Key_Ent, Key_C_Ent, Key_A_Ent },
{ VK_ESCAPE, Key_Esc, Key_Esc, Key_Esc, Key_A_Esc }, { VK_ESCAPE, Key_Esc, Key_Esc, Key_Esc, Key_A_Esc },
{ VK_SPACE, -1, -1, Key_Space, Key_Space }, { 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 }, { '0', Key_0, Key_S_0, -1, Key_A_0 },
{ '1', Key_1, Key_S_1, -1, Key_A_1 }, { '1', Key_1, Key_S_1, -1, Key_A_1 },
@ -933,27 +933,30 @@ int gkbd_nt2bios(INPUT_RECORD& inp) {
c = k->alt; c = k->alt;
else if(state & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED)) else if(state & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED))
c = k->ctrl; c = k->ctrl;
else if(state & SHIFT_PRESSED) { else if(state & SHIFT_PRESSED)
if(k->shift == -1) {
c = ascii; if (k->shift == -1)
c = ascii ? ascii : -1;
else else
c = k->shift; c = k->shift;
} }
else { else {
// If it is a letter key, use the ASCII value supplied // If it is a letter key, use the ASCII value supplied
// by NT to take into account the CapsLock state. // by NT to take into account the CapsLock state.
if(g_isupper(keycode) or (k->normal == -1)) if (g_isupper(keycode) or (k->normal == -1))
c = ascii; c = ascii ? ascii : -1;
else else
c = k->normal; c = k->normal;
} }
if(c != -1) 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 (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; return (ascii == ' ') ? Key_Space : ascii;
if(ISEXT(c)) if (ISEXT(c))
return EXTVAL(c) << 8; return EXTVAL(c) << 8;
}
return c; return c;
} }