home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!kth.se!hemul.nada.kth.se!d88-jwa
- From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Detecting mouse position in a window ?
- Keywords: faq mouse in window regions etc help
- Message-ID: <1993Jan12.132059.9247@kth.se>
- Date: 12 Jan 93 13:20:59 GMT
- References: <rudolph.726810080@unixg.ubc.ca> <1993Jan12.050224.14617@magnus.acs.ohio-state.edu>
- Sender: usenet@kth.se (Usenet)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Lines: 22
- Nntp-Posting-Host: hemul.nada.kth.se
-
- In <1993Jan12.050224.14617@magnus.acs.ohio-state.edu> jbush@magnus.acs.ohio-state.edu (J Eric Bush) writes:
-
- >Just use the GetMouse(p:point) procedure. If at first it gives you a global
- >point, then all you have to do it say point:=GlobalToLocal(p).
-
- This is wrong; instead, create a region (in global coordinates)
- that covers ALL the areas where the cursor should stay the
- same as it is now; pass that region to WaitNextEvent. Also set
- the cursor appropriately before each call to WaitNextEvent.
-
- Now, everytime the cursor strays outside the appropriate area
- for its shape, you will get a mouseMoved event (osEvt, app4Evt)
- and before calling WaitNextEvent the next time, you will set the
- cursor to its new shape and calculate a new region.
-
- Cheers,
-
- / h+
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
- This signature is kept shorter than 4 lines in the interests of UseNet
- S/N ratio.
-