mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +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;
|
||||
|
||||
default:
|
||||
#ifdef __REACTOS__
|
||||
ch = ir.Event.KeyEvent.AsciiChar;
|
||||
if ((ch >= 32) && (charcount != (maxlen - 2)))
|
||||
{
|
||||
#else
|
||||
#ifdef _UNICODE
|
||||
ch = ir.Event.KeyEvent.uChar.UnicodeChar;
|
||||
if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)))
|
||||
#else
|
||||
ch = ir.Event.KeyEvent.uChar.AsciiChar;
|
||||
if ((ch >= 32) && (charcount != (maxlen - 2)))
|
||||
#endif /* _UNICODE */
|
||||
if ((ch >= 32 && ch <= 255) && (charcount != (maxlen - 2)))
|
||||
{
|
||||
#endif /* __REACTOS__ */
|
||||
/* insert character into string... */
|
||||
if (bInsert && current != charcount)
|
||||
{
|
||||
|
|
|
@ -62,15 +62,11 @@ TCHAR cgetchar (VOID)
|
|||
}
|
||||
while (TRUE);
|
||||
|
||||
#ifdef __REACTOS__
|
||||
return irBuffer.Event.KeyEvent.AsciiChar;
|
||||
#else
|
||||
#ifndef _UNICODE
|
||||
return irBuffer.Event.KeyEvent.uChar.AsciiChar;
|
||||
#else
|
||||
return irBuffer.Event.KeyEvent.uChar.UnicodeChar;
|
||||
#endif /* _UNICODE */
|
||||
#endif /* __REACTOS__ */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -498,7 +498,7 @@ static unsigned int KeyboardHandler(unsigned int irq)
|
|||
rec[KeysRead].wRepeatCount=1;
|
||||
rec[KeysRead].wVirtualKeyCode=ScanToVirtual(thisKey);
|
||||
rec[KeysRead].wVirtualScanCode=thisKey;
|
||||
rec[KeysRead].AsciiChar=VirtualToAscii(rec->wVirtualKeyCode,isDown);
|
||||
rec[KeysRead].uChar.AsciiChar=VirtualToAscii(rec->wVirtualKeyCode,isDown);
|
||||
rec[KeysRead].dwControlKeyState=ctrlKeyState;
|
||||
if (extKey)
|
||||
{
|
||||
|
@ -525,8 +525,9 @@ static unsigned int KeyboardHandler(unsigned int irq)
|
|||
kbdBuffer[bufHead].wRepeatCount=1;
|
||||
kbdBuffer[bufHead].wVirtualKeyCode=ScanToVirtual(thisKey);
|
||||
kbdBuffer[bufHead].wVirtualScanCode=thisKey;
|
||||
kbdBuffer[bufHead].uChar.UnicodeChar=0;
|
||||
// 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;
|
||||
if (extKey)
|
||||
kbdBuffer[bufHead].dwControlKeyState|=ENHANCED_KEY;
|
||||
|
|
|
@ -340,14 +340,14 @@ typedef struct _KEY_EVENT_RECORD {
|
|||
WORD wVirtualKeyCode;
|
||||
WORD wVirtualScanCode;
|
||||
|
||||
char AsciiChar;
|
||||
char pad;
|
||||
#if 0
|
||||
// char AsciiChar;
|
||||
// char pad;
|
||||
//#if 0
|
||||
union {
|
||||
WCHAR UnicodeChar;
|
||||
CHAR AsciiChar;
|
||||
} uChar;
|
||||
#endif
|
||||
//#endif
|
||||
DWORD dwControlKeyState;
|
||||
} KEY_EVENT_RECORD PACKED;
|
||||
|
||||
|
|
|
@ -141,9 +141,9 @@ ReadConsoleA(HANDLE hConsoleInput,
|
|||
sizeof(KEY_EVENT_RECORD),
|
||||
&Result,
|
||||
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++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue