home *** CD-ROM | disk | FTP | other *** search
- #include <dos.h>
-
- void
- mouse_present()
- {
- static char *mtypes[] = {
- "Bus",
- "Serial",
- "InPort",
- "PS/2",
- "HP"
- };
- union REGS r;
- r.x.ax = 0;
- int86(0x33,&r,&r);
- if (!r.x.ax)
- {
- printf("\nNo mouse driver found\n");
- return;
- }
-
- printf("\nA Mouse is present\n");
-
- r.x.ax = 0x24;
- int86(0x33,&r,&r);
- if (r.h.bh < 6 || r.h.ch > 5 || r.h.cl > 7)
- {
- printf(" Driver does not support 'mouse information' request.\n");
- return;
- }
-
- printf(" Driver version %x.%02x\n",r.h.bh,r.h.bl);
- printf(" %s mouse.\n",mtypes[r.h.ch-1]);
- if (r.h.cl)
- printf(" IRQ %d\n",r.h.cl);
- else
- printf(" Uses PS/2 mouse port\n");
- }