Fix some bad behavior when some lock states (capslock, numlock...)

were turned on.
This commit is contained in:
Eric Pouech 2002-01-10 18:20:51 +00:00 committed by Alexandre Julliard
parent dce7e5cf8e
commit 824a7f120a
1 changed files with 4 additions and 1 deletions

View File

@ -632,6 +632,7 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, int use_emacs)
KeyEntry* ke;
unsigned ofs;
void (*func)(struct WCEL_Context* ctx);
DWORD ks;
memset(&ctx, 0, sizeof(ctx));
ctx.hConIn = hConsoleIn;
@ -659,11 +660,13 @@ WCHAR* CONSOLE_Readline(HANDLE hConsoleIn, int use_emacs)
/* EPP WCEL_Dump(&ctx, "before func"); */
ofs = ctx.ofs;
/* mask out some bits which don't interest us */
ks = ir.Event.KeyEvent.dwControlKeyState & ~(NUMLOCK_ON|SCROLLLOCK_ON|CAPSLOCK_ON);
func = NULL;
for (km = (use_emacs) ? EmacsKeyMap : Win32KeyMap; km->entries != NULL; km++)
{
if (km->keyState != ir.Event.KeyEvent.dwControlKeyState)
if (km->keyState != ks)
continue;
if (km->chkChar)
{