Mail Archives: djgpp/1997/11/30/07:02:38
From: | Patrick Reilly <reillyp AT gte DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Accessing the mouse using DJGPP under DOS in protected-mode
|
Date: | 30 Nov 1997 11:17:36 GMT
|
Organization: | gte.net
|
Lines: | 31
|
Message-ID: | <65ri0g$i2g$1@gte2.gte.net>
|
References: | <34803FC9 DOT 2DBD AT csinet DOT net>
|
NNTP-Posting-Host: | 1cust251.tnt1.columbia.mo.da.uu.net
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Mice are normally accessed via the standard microsoft INT 0x33 (search
the web for Ralf Brown's Interrupt List, or others, for info on the
mouse interrupt).
For the mouse functions that do not pass pointers (eg: hide cursor, show
cursor) you can just call the interrupt and the DPMI host will reflect
it to the real-mode handler that was installed with mouse.sys or
mouse.com.
For mouse functions that pass pointers (eg: get/set cursor shape) you
need to allocate the buffer in real-mode space (the bottom 1MB); DPMI
privides this - see DJGPP docs for wrappers that he's added (I'm not all
that familiar with the RTL for DJGPP), and use DPMI to simulate a
real-mode interrupt (again, DJGPP has wrappers for this).
Finally, the int 0x33 mouse handler allows you to install a callback
that will get called when the user clicks, moves, etc (you pass in a
mask telling which events to call you on). Of course, the real-mode
mouse driver expects a real-mode far address - DPMI provides a real-mode
callback mechanism (search docs for rmcb-xxxx - that's the names for the
variables in the DJGPP source anyway <g>) - basically it creates a
16-bit thunk that the mouse driver calls, goes into pmode, and calls
your 32-bit pmode routine.
Pat
chris/Tim wrote:
>
> Does anyone know where I can get information about this ?
> or (hopefully) working sample code..
> Tim (christim AT csinet DOT net)
- Raw text -