void _interrupt _far newkbisr(void)
#endif
{
      static extkey;
      BYTE scancode = (BYTE)keyport();         /* read keyboard scan code */

      if (scancode == 0xe0)
            extkey = 1;               /* use ekey array on next scan code */
      else
      {
            if (scancode & 0x80)                          /* key released */
                  (extkey ? ekeys : keys)[scancode & 0x7f] = 0;
            else  (extkey ? ekeys : keys)[scancode] = 1;
            extkey = 0;
      }

#ifdef __ZTC__
      return 0;                         /* chain to previous keyboard ISR */
#else
      oldkbisr();                       /* chain to previous keyboard ISR */
#endif
}
Exemple #2
0
static void INTERRUPT FAR newkbisr(void)
{
      static int count = 0;
      int key = keyport();

      if (KBtrap_active)
      {
            if (count)
            {
                  unsigned char kbin;

                  --count;

                  if (PRTSCRNSCAN == key)
                        PrtScrnPending = True_;
IGNORE:
                  kbin = (unsigned char)inp(KEYPORT+1); /* reset keyboard  */
                  outp(KEYPORT+1, kbin|0x80);
                  outp(KEYPORT+1, kbin);
                  disable();
                  outp(CONTROLLERPORT,0x20); /* tell controller to shut up */
                  enable();
                  return;
            }
            else switch (key)
            {
            case MULTI2SCAN:
                  count = 1;
                  goto IGNORE;

            case MULTI3SCAN:
                  count = 2;
                  goto IGNORE;

            case DELSCAN:
                  if (CTRLALT == (kbstat() & CTRLALT))
                        goto IGNORE;
                  break;
                  
            case PRTSCRNSCAN:
                  PrtScrnPending = True_;
                  goto IGNORE;
                  
            case CSCAN:
            case BREAKSCAN:
                  if (CTRL == (kbstat() & CTRL))
                        goto IGNORE;
                  break;
                  
            case SYSREQSCAN:
                  goto IGNORE;
            }
      }
      else
      {
            if (count)
            {
                  --count;
                  return;
            }
      }
      oldkbisr();                         /* chain to old keyboard isr */
}