home *** CD-ROM | disk | FTP | other *** search
- /*
- * Keyboard test program
- */
-
- #include <dos.h>
-
- int main(argc, argv)
- int argc;
- char **argv;
- {
- union REGS regs;
-
- printf ("Keyboard test (use Esc to exit)\n\n");
- for (;;)
- {
- regs.h.ah = 0;
- int86 (0x16, ®s, ®s);
- if ( regs.h.al )
- {
- printf ("Normal key, scancode: %3d(dec), %2x(hex) ",
- regs.h.ah, regs.h.ah);
- printf (" Value: %3d(dec), %2x(hex), Ascii:%c\n",
- regs.h.al, regs.h.al, regs.h.al);
- if ( regs.h.al == 033 )
- break;
- }
- else
- printf ("Extended key, scancode: %3d(dec), %2x(hex)\n",
- regs.h.ah, regs.h.ah);
- }
- }
-