Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting mouse coordinates?

0 views
Skip to first unread message

Thomas Ingham

unread,
Nov 6, 1996, 3:00:00 AM11/6/96
to

How does one go about getting the mouse coordinates read into a
function. I would really appreciate some help on this one...

thanks
tom
--
Check out my groovy website!!!
http://www.dreamscape.com/tasocors

Steven Bennett

unread,
Nov 7, 1996, 3:00:00 AM11/7/96
to

Thomas Ingham wrote:
> How does one go about getting the mouse coordinates read into a
> function. I would really appreciate some help on this one...

There's a MacOS function called GetMouse() which will do this for you.
This will give you the screen coordinates of the mouse cursor. If you
want them relative to a window, you will need to use the GlobalToLocal
function to convert the coordinates.

-->Steve Bennett

Johan Halmen UPR

unread,
Nov 10, 1996, 3:00:00 AM11/10/96
to

Steven Bennett (s...@pond.com) wrote:

Declare a point variable:

Point MouseLocation;

Read the mouse location into MouseLocation:

GetMouse(&MouseLocation);

Now you find the horizontal and vertical mouse location
in MouseLocation.h and MouseLocation.v

Johan Halmen


Timothy C. Delaney

unread,
Nov 11, 1996, 3:00:00 AM11/11/96
to

In article <56473k$c...@josie.abo.fi>, jha...@news.abo.fi (Johan Halmen
UPR) wrote:

One thing: GetMouse() returns the mouse coordinates in the *local*
coordinates of the current grafport - so to get to screen coordinates you
need to use LocalToGlobal() (followed by SetPort()/SetGWorld() and
GlobalToLocal() to convert it to the local coordinates of another port).

--
<http://www.zip.com.au/~magao/standard_disclaimer.html>

_/_/_/_/
__| __| _/_| _/_/_/ _/_| _/_/_/
_/_| _/_| _/ _| _/ _/ _| _/ _/
-/ _|_/ _| _/_/_/_| _/ _/_/_/ _/_/_/_| _/ _/
_/ __/ _| _/ _| _/_/_/ _/ _| _/_/_/

Tim Delaney ma...@zip.com.au
Mac/Windows SW Engineer, Bold ma...@bold.com.au

0 new messages