www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/26/08:55:52

From: root AT eyal DOT emu DOT id DOT au (root)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Djgpp mouse handler without asm ????
Date: 25 Sep 96 22:39:36 GMT
Organization: Eyal at home
Lines: 22
Message-ID: <3249b4a8.0@cheese.pcug.org.au>
References: <32488EB9 DOT 8F4 AT df DOT allcon DOT com>
NNTP-Posting-Host: cheese.pcug.org.au
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <32488EB9 DOT 8F4 AT df DOT allcon DOT com>,
	Dennis Jan Franken <DjFranken AT df DOT allcon DOT com> writes:
> Is it possible to set up a mouse handler in DJGPP without using
> an ASM wrapper ????

Just use the dos interrupt 0x33 to access the mouse, for example:

        union REGS      rg;

        rg.x.ax = 3;            /* Get button status and mouse position */
        int86(0x33, &rg, &rg);

         x = rg.x.dx >> 3;
         y = rg.x.cx >> 3;
         buttons = rg.x.bx;

The buttons are the low order bits.

There are similar calls to set the mouse esolution, speed and position.
 
--
Eyal Lebedinsky		(eyal AT eyal DOT emu DOT id DOT au)

- Raw text -


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