mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[NTVDM]
In the DOS CON driver, for special keys, always send the scancode right after the 0x00 byte. svn path=/trunk/; revision=66906
This commit is contained in:
parent
d4956b9c39
commit
034607a078
|
@ -21,13 +21,14 @@
|
|||
/* PRIVATE VARIABLES **********************************************************/
|
||||
|
||||
PDOS_DEVICE_NODE ConIn = NULL, ConOut = NULL;
|
||||
BYTE ExtendedCode = 0;
|
||||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
|
||||
WORD NTAPI ConDrvReadInput(PDOS_DEVICE_NODE Device, DWORD Buffer, PWORD Length)
|
||||
{
|
||||
CHAR Character;
|
||||
WORD BytesRead;
|
||||
WORD BytesRead = 0;
|
||||
PCHAR Pointer = (PCHAR)FAR_POINTER(Buffer);
|
||||
|
||||
/* Save AX */
|
||||
|
@ -36,7 +37,9 @@ WORD NTAPI ConDrvReadInput(PDOS_DEVICE_NODE Device, DWORD Buffer, PWORD Length)
|
|||
/*
|
||||
* Use BIOS Get Keystroke function
|
||||
*/
|
||||
for (BytesRead = 0; BytesRead < *Length; BytesRead++)
|
||||
while (BytesRead < *Length)
|
||||
{
|
||||
if (!ExtendedCode)
|
||||
{
|
||||
/* Call the BIOS INT 16h, AH=00h "Get Keystroke" */
|
||||
setAH(0x00);
|
||||
|
@ -44,9 +47,21 @@ WORD NTAPI ConDrvReadInput(PDOS_DEVICE_NODE Device, DWORD Buffer, PWORD Length)
|
|||
|
||||
/* Retrieve the character in AL (scan code is in AH) */
|
||||
Character = getAL();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Return the extended code */
|
||||
Character = ExtendedCode;
|
||||
|
||||
/* And then clear it */
|
||||
ExtendedCode = 0;
|
||||
}
|
||||
|
||||
/* Check if this is a special character */
|
||||
if (Character == 0) ExtendedCode = getAH();
|
||||
|
||||
if (DoEcho) DosPrintCharacter(DOS_OUTPUT_HANDLE, Character);
|
||||
Pointer[BytesRead] = Character;
|
||||
Pointer[BytesRead++] = Character;
|
||||
|
||||
/* Stop on first carriage return */
|
||||
if (Character == '\r')
|
||||
|
|
|
@ -2030,7 +2030,7 @@ VOID WINAPI DosInt21h(LPWORD Stack)
|
|||
WORD BytesRead = 0;
|
||||
WORD ErrorCode;
|
||||
|
||||
DPRINT1("INT 21h, AH = 3Fh\n");
|
||||
DPRINT("DosReadFile(0x%04X)\n", getBX());
|
||||
|
||||
DoEcho = TRUE;
|
||||
ErrorCode = DosReadFile(getBX(),
|
||||
|
|
Loading…
Reference in a new issue