#include <stdio.h>
#include <dos.h>
#include <ctype.h>
#include "bioskeye.h"

#define ESC    0x011B

int main(void)
{
   int key, modifiers;
   int done;

   printf("\n");
   printf("Extended Keyboard 'BIOSKEYE' Demo Utility\n\n");
   printf("Press ESC to quit\n\n");
   done = 0;
   while(!done) {
      /* -----------------function 1 returns 0 until a key is pressed */
      while(bioskeye(1) == 0);

      /* ------------------function 0 returns the key that is waiting */
      key = bioskeye(0);

      /* ----------use function 2 to determine if shit keys were used */
      modifiers = bioskeye(2);

      /* --------------------------------print out the character read */
      printf("Key pressed was: ");
      printf("Value=%04Xh, ",key);
      printf("Shift Status=%04Xh\r",modifiers);

     if (key == ESC) done = 1;
   }
   printf("\n");

   return 0;
}
