/* Wait for keystroke and read */
case 0x00:
/* Wait for extended keystroke and read */
- case 0x10: // FIXME: Temporarily do the same as INT 16h, 00h
+ case 0x10:
{
WORD Character;
break;
}
+ if (getAH() == 0x00 && LOBYTE(Character) == 0xE0)
+ {
+ /* Clear the extended code */
+ Character &= 0xFF00;
+ }
+
BiosKbdBufferPop();
setAX(Character);
/* Get keystroke status */
case 0x01:
/* Get extended keystroke status */
- case 0x11: // FIXME: Temporarily do the same as INT 16h, 01h
+ case 0x11:
{
WORD Character;
Stack[STACK_FLAGS] |= EMULATOR_FLAG_ZF;
}
+ if (getAH() == 0x01 && LOBYTE(Character) == 0xE0)
+ {
+ /* Clear the extended code */
+ Character &= 0xFF00;
+ }
+
break;
}
// Keyboard IRQ 1
static VOID WINAPI BiosKeyboardIrq(LPWORD Stack)
{
+ static BOOLEAN Extended = FALSE;
BOOLEAN SkipScanCode;
BYTE ScanCode, VirtualKey;
WORD Character;
setAX(AX);
setCF(CF);
+ if (ScanCode == 0xE0)
+ {
+ Extended = TRUE;
+ goto Quit;
+ }
+
/* Check whether CF is clear. If so, skip the scan code. */
if (SkipScanCode) goto Quit;
default:
{
- Character = 0;
+ Character = Extended ? 0xE0 : 0x00;
- /* If ALT isn't held down, find out which character this is */
- if (!(Bda->KeybdShiftFlags & (BDA_KBDFLAG_ALT | BDA_KBDFLAG_LALT | BDA_KBDFLAG_RALT)))
+ /* If this is not an extended scancode, and ALT isn't held down, find out which character this is */
+ if (!Extended && !(Bda->KeybdShiftFlags & (BDA_KBDFLAG_ALT | BDA_KBDFLAG_LALT | BDA_KBDFLAG_RALT)))
{
if (ToAscii(VirtualKey, ScanCode, BiosKeyboardMap, &Character, 0) == 0)
{
if (BiosKeyboardMap[VK_CAPITAL] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_CAPSLOCK;
if (BiosKeyboardMap[VK_INSERT] & (1 << 7)) Bda->KeybdShiftFlags |= BDA_KBDFLAG_INSERT;
+ /* Clear the extended key flag */
+ Extended = FALSE;
+
DPRINT("BiosKeyboardIrq - Character = 0x%X, ScanCode = 0x%X, KeybdShiftFlags = 0x%X\n",
Character, ScanCode, Bda->KeybdShiftFlags);