/* * DOS interrupt 09h handler (IRQ1 - KEYBOARD) */ #include #include #include "windef.h" #include "winbase.h" #include "wingdi.h" #include "winuser.h" #include "miscemu.h" #include "debugtools.h" #include "callback.h" #include "dosexe.h" DEFAULT_DEBUG_CHANNEL(int); #define QUEUELEN 31 static struct { BYTE queuelen,queue[QUEUELEN],ascii[QUEUELEN]; } kbdinfo; /********************************************************************** * INT_Int09Handler * * Handler for int 09h. */ void WINAPI INT_Int09Handler( CONTEXT86 *context ) { BYTE ascii, scan = INT_Int09ReadScan(&ascii); BYTE ch[2]; int cnt, c2; TRACE("scan=%02x\n",scan); if (!(scan & 0x80)) { if (ascii) { /* we already have an ASCII code, no translation necessary */ ch[0] = ascii; cnt = 1; } else { UINT vkey = MapVirtualKeyA(scan&0x7f, 1); BYTE keystate[256]; GetKeyboardState(keystate); cnt = ToAscii(vkey, scan, keystate, (LPWORD)ch, 0); } if (cnt>0) { for (c2=0; c2