[fpc-pascal]graph unit and the mouse

Michael.VanCanneyt at Wisa.be Michael.VanCanneyt at Wisa.be
Mon Feb 10 12:08:05 CET 2003

On Sun, 9 Feb 2003, Mark Emerson wrote:

> Florian Klaempfl wrote:
> >
> > Mark Emerson wrote:
> > > Does anybody know a way to read the mouse at pixel resolution while
> > > using the graph unit?
> > >
> >
> > You mean for go32v2? It depends on your mouse driver I think.
> >
> Please excuse my ignornace, but I don't yet understand what "go32v2"
> means...I see this term used in the FPC documentation in connection with
> platforms, but I've never heard of it.  Is it a processor?  Or an OS?
> Or what?

go32v2 is a so-called dos extender: It allows 32-bit programs to run on
plain DOS. It was written by D.J. Delorie (http://www.delorie.com)

Since FPC is a 32 bit compiler, it relies on the services of such an
extender. Another such extender is EMX, or WDOSX.

> I am running entirely in graphics mode and am using the graph unit to
> accomplish this.  I am creating state-of-the-art graphics that can be
> manipulated by the user via the mouse.  I simply need to be able to read
> mouse events (and also to change the mouse cursor).  The application I'm
> creating must run on Win32, Linux and Unix (and Mac when FPC is
> ready)...with separate compilations for each platform as needed.
> The units in the RTL are system independent, which I greatly appreciate.
>  I also greatly appreciate the graph unit's capability to select the
> highest resolution possible for any machine.  However, the mouse unit
> offers only "character" granularity resolution which won't work in a
> hi-res graphics environment...I need the mouse resolution to be at the
> pixel level, as it is in any modern GUI.
> How can I achieve this?

The best way to go about this is not to use the graph unit. The graph unit
is provided for TP compatibility, but modern-day GUI systems do not work
with the same paradigm. I suggest you look into using GTK or so. It's
relatively cross-platform as well, and is quite well supported by FPC.


More information about the fpc-pascal mailing list