mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:33:10 +00:00
Fixed KEY_EVENT_RECORD.
svn path=/trunk/; revision=438
This commit is contained in:
parent
7f7d1d57b0
commit
09b99f1097
5 changed files with 11 additions and 19 deletions
|
@ -360,19 +360,14 @@ VOID ReadCommand (LPTSTR str, INT maxlen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
#ifdef __REACTOS__
|
|
||||||
ch = ir.Event.KeyEvent.AsciiChar;
|
|
||||||
if ((ch >= 32) && (charcount != (maxlen - 2)))
|
|
||||||
{
|
|
||||||
#else
|
|
||||||
#ifdef _UNICODE
|
#ifdef _UNICODE
|
||||||
ch = ir.Event.KeyEvent.uChar.UnicodeChar;
|
ch = ir.Event.KeyEvent.uChar.UnicodeChar;
|
||||||
|
if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)))
|
||||||
#else
|
#else
|
||||||
ch = ir.Event.KeyEvent.uChar.AsciiChar;
|
ch = ir.Event.KeyEvent.uChar.AsciiChar;
|
||||||
|
if ((ch >= 32) && (charcount != (maxlen - 2)))
|
||||||
#endif /* _UNICODE */
|
#endif /* _UNICODE */
|
||||||
if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)))
|
|
||||||
{
|
{
|
||||||
#endif /* __REACTOS__ */
|
|
||||||
/* insert character into string... */
|
/* insert character into string... */
|
||||||
if (bInsert && current != charcount)
|
if (bInsert && current != charcount)
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,15 +62,11 @@ TCHAR cgetchar (VOID)
|
||||||
}
|
}
|
||||||
while (TRUE);
|
while (TRUE);
|
||||||
|
|
||||||
#ifdef __REACTOS__
|
|
||||||
return irBuffer.Event.KeyEvent.AsciiChar;
|
|
||||||
#else
|
|
||||||
#ifndef _UNICODE
|
#ifndef _UNICODE
|
||||||
return irBuffer.Event.KeyEvent.uChar.AsciiChar;
|
return irBuffer.Event.KeyEvent.uChar.AsciiChar;
|
||||||
#else
|
#else
|
||||||
return irBuffer.Event.KeyEvent.uChar.UnicodeChar;
|
return irBuffer.Event.KeyEvent.uChar.UnicodeChar;
|
||||||
#endif /* _UNICODE */
|
#endif /* _UNICODE */
|
||||||
#endif /* __REACTOS__ */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -498,7 +498,7 @@ static unsigned int KeyboardHandler(unsigned int irq)
|
||||||
rec[KeysRead].wRepeatCount=1;
|
rec[KeysRead].wRepeatCount=1;
|
||||||
rec[KeysRead].wVirtualKeyCode=ScanToVirtual(thisKey);
|
rec[KeysRead].wVirtualKeyCode=ScanToVirtual(thisKey);
|
||||||
rec[KeysRead].wVirtualScanCode=thisKey;
|
rec[KeysRead].wVirtualScanCode=thisKey;
|
||||||
rec[KeysRead].AsciiChar=VirtualToAscii(rec->wVirtualKeyCode,isDown);
|
rec[KeysRead].uChar.AsciiChar=VirtualToAscii(rec->wVirtualKeyCode,isDown);
|
||||||
rec[KeysRead].dwControlKeyState=ctrlKeyState;
|
rec[KeysRead].dwControlKeyState=ctrlKeyState;
|
||||||
if (extKey)
|
if (extKey)
|
||||||
{
|
{
|
||||||
|
@ -525,8 +525,9 @@ static unsigned int KeyboardHandler(unsigned int irq)
|
||||||
kbdBuffer[bufHead].wRepeatCount=1;
|
kbdBuffer[bufHead].wRepeatCount=1;
|
||||||
kbdBuffer[bufHead].wVirtualKeyCode=ScanToVirtual(thisKey);
|
kbdBuffer[bufHead].wVirtualKeyCode=ScanToVirtual(thisKey);
|
||||||
kbdBuffer[bufHead].wVirtualScanCode=thisKey;
|
kbdBuffer[bufHead].wVirtualScanCode=thisKey;
|
||||||
|
kbdBuffer[bufHead].uChar.UnicodeChar=0;
|
||||||
// kbdBuffer[bufHead].uChar.AsciiChar=TranslateScanCode(thisKey);
|
// kbdBuffer[bufHead].uChar.AsciiChar=TranslateScanCode(thisKey);
|
||||||
kbdBuffer[bufHead].AsciiChar=VirtualToAscii(kbdBuffer[bufHead].wVirtualKeyCode,isDown);
|
kbdBuffer[bufHead].uChar.AsciiChar=VirtualToAscii(kbdBuffer[bufHead].wVirtualKeyCode,isDown);
|
||||||
kbdBuffer[bufHead].dwControlKeyState=ctrlKeyState;
|
kbdBuffer[bufHead].dwControlKeyState=ctrlKeyState;
|
||||||
if (extKey)
|
if (extKey)
|
||||||
kbdBuffer[bufHead].dwControlKeyState|=ENHANCED_KEY;
|
kbdBuffer[bufHead].dwControlKeyState|=ENHANCED_KEY;
|
||||||
|
|
|
@ -340,14 +340,14 @@ typedef struct _KEY_EVENT_RECORD {
|
||||||
WORD wVirtualKeyCode;
|
WORD wVirtualKeyCode;
|
||||||
WORD wVirtualScanCode;
|
WORD wVirtualScanCode;
|
||||||
|
|
||||||
char AsciiChar;
|
// char AsciiChar;
|
||||||
char pad;
|
// char pad;
|
||||||
#if 0
|
//#if 0
|
||||||
union {
|
union {
|
||||||
WCHAR UnicodeChar;
|
WCHAR UnicodeChar;
|
||||||
CHAR AsciiChar;
|
CHAR AsciiChar;
|
||||||
} uChar;
|
} uChar;
|
||||||
#endif
|
//#endif
|
||||||
DWORD dwControlKeyState;
|
DWORD dwControlKeyState;
|
||||||
} KEY_EVENT_RECORD PACKED;
|
} KEY_EVENT_RECORD PACKED;
|
||||||
|
|
||||||
|
|
|
@ -141,9 +141,9 @@ ReadConsoleA(HANDLE hConsoleInput,
|
||||||
sizeof(KEY_EVENT_RECORD),
|
sizeof(KEY_EVENT_RECORD),
|
||||||
&Result,
|
&Result,
|
||||||
NULL);
|
NULL);
|
||||||
if (stat && KeyEventRecord.bKeyDown && KeyEventRecord.AsciiChar != 0)
|
if (stat && KeyEventRecord.bKeyDown && KeyEventRecord.uChar.AsciiChar != 0)
|
||||||
{
|
{
|
||||||
Buffer[i] = KeyEventRecord.AsciiChar;
|
Buffer[i] = KeyEventRecord.uChar.AsciiChar;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue