www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/16/22:50:08

From: Jeff Weeks <pweeks AT execulink DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: mouse detection in DJGPP. Need help.
Date: 17 Apr 1997 00:11:36 GMT
Organization: Code X Software
Lines: 53
Message-ID: <5j3pro$pn6@nr1.toronto.istar.net>
NNTP-Posting-Host: ppp1.leo.execulink.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi, I've been converting some of my old TC++ routines into DJGPP for a
long time and thought I'd tackle my mouse class, figuring it'd be real
easy.  It hasn't been :).  I can't get it to detect the presence of a
mouse.  I've tried three different things.

Here's what I've got so far:

    void reset(void) {
       _go32_dpmi_seginfo mouse_vector;
       int present;
     
       printf("Checking mouse interrupt vector\n");
       if(_go32_dpmi_get_protected_mode_interrupt_vector(0x33,
&mouse_vector)) {
         printf("First check: Mouse not found!\n");
         exit(1);
       }

       if(mouse_vector.pm_offset == NULL ||
          mouse_vector.pm_selector == NULL) {
            printf("Second check: I'm not seeing a mouse!\n");
            exit(1);
       }

	   regs.h.ah = 0x35;     /* DOS get vector */
	   regs.h.al = 0x33;     /* mouse vector   */
      __dpmi_int(0x21,&regs);

	   /* ES:BX now contains the pointer to the interrupt handler */
	   if (regs.x.es == 0 || regs.x.bx == 0) {
        printf("Third check: Still no mouse!\n");
        exit(1);
      }

      regs.x.ax = 0;
      __dpmi_int(0x33,&regs);
      // mouse type is in bx, mouse present? is in ax
    }



As you can see, I've tried a few things.  But each one of them seems to
say a mouse is present which it most definitly isn't!  Any ideas?

Jeff

--------------------------------------------
            - Code X Software -
       Programming to a Higher Power
  
  email: mailto:pweeks AT execulink DOT com
  web:	 http://www.execulink.com/~pweeks/
--------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019