home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / SNIP9404.ZIP / KB_DATA.C < prev    next >
C/C++ Source or Header  |  1994-04-03  |  2KB  |  51 lines

  1. /* by: Dan Kozak */
  2.  
  3. #include <stdio.h>
  4.  
  5. #ifdef __TURBOC__
  6.  #define _far far
  7. #endif
  8.  
  9. typedef struct                     /* Keyboard status structure */
  10.  {
  11.   unsigned int
  12.   right_shift_down  : 1,           /* Right Shift key depressed */
  13.   left_shift_down   : 1,            /* Left Shift key depressed */
  14.   ctrl_shift_down   : 1,                  /* Ctrl key depressed */
  15.   alt_shift_down    : 1,                   /* Alt key depressed */
  16.   scroll_on         : 1,                   /* Scroll Lock is on */
  17.   num_on            : 1,                      /* Num Lock is on */
  18.   caps_on           : 1,                     /* Caps Lock is on */
  19.   ins_on            : 1,              /* Insert state is active */
  20.   filler            : 3,           /* Filler for word alignment */
  21.   ctrl_numloc       : 1,                   /* Suspend key is on */
  22.   scroll_down       : 1,           /* Scroll Lock key depressed */
  23.   num_down          : 1,              /* Num Lock key depressed */
  24.   caps_down         : 1,             /* Caps Lock key depressed */
  25.   ins_down          : 1;                /* Insert key depressed */
  26.  } biosshiftstate;
  27.  
  28. biosshiftstate _far *kbd_status = (biosshiftstate _far *) 0x00000417L;
  29.  
  30. main()
  31. {
  32.       while(1)
  33.       {
  34.             printf("right_shift_down = %d\n",kbd_status->right_shift_down);
  35.             printf("left_shift_down = %d\n",kbd_status->left_shift_down);
  36.             printf("ctrl_shift_down = %d\n",kbd_status->ctrl_shift_down);
  37.             printf("alt_shift_down = %d\n",kbd_status->alt_shift_down);
  38.             printf("scroll_on = %d\n",kbd_status->scroll_on);
  39.             printf("num_on = %d\n",kbd_status->num_on);
  40.             printf("caps_on = %d\n",kbd_status->caps_on);
  41.             printf("ins_on = %d\n",kbd_status->ins_on);
  42.             printf("filler = %d\n",kbd_status->filler);
  43.             printf("ctrl_numloc = %d\n",kbd_status->ctrl_numloc);
  44.             printf("scroll_down = %d\n",kbd_status->scroll_down);
  45.             printf("num_down = %d\n",kbd_status->num_down);
  46.             printf("caps_down = %d\n",kbd_status->caps_down);
  47.             printf("ins_down = %d\n",kbd_status->ins_down);
  48.       }
  49.       return 0;
  50. }
  51.