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:
Aleksandar Andrejevic 2015-03-26 23:19:22 +00:00
parent d4956b9c39
commit 034607a078
2 changed files with 24 additions and 9 deletions

View file

@ -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,17 +37,31 @@ 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)
{
/* Call the BIOS INT 16h, AH=00h "Get Keystroke" */
setAH(0x00);
Int32Call(&DosContext, BIOS_KBD_INTERRUPT);
if (!ExtendedCode)
{
/* Call the BIOS INT 16h, AH=00h "Get Keystroke" */
setAH(0x00);
Int32Call(&DosContext, BIOS_KBD_INTERRUPT);
/* Retrieve the character in AL (scan code is in AH) */
Character = getAL();
/* 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')

View file

@ -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(),