Article View: comp.sys.mac
Article #12468Re: Help! Anyone know how to force the mouse to a location?
From: Matt Mora
Date: Tue, 05 Jun 1990 15:51
Date: Tue, 05 Jun 1990 15:51
59 lines
2628 bytes
2628 bytes
In article <16995@phoenix.Princeton.EDU> bskendig@phoenix.Princeton.EDU (Brian Kendig) writes:
>In article <1990Jun5.091419.14219@portia.Stanford.EDU> canuck@portia.Stanford.EDU (William Stocker) writes:
>>I'm writing a Mac program in THINK Pascal 3.0, and need to force the
>>mouse to a particular screen location. I'm sure it's against Apple's
>>guidelines (there's no SetMouse command I can find in Inside Mac I-V),
>>but there's a good purpose for it -- trust me!
>
> DON'T DO IT. It's *very* bad technique, and your application
> won't run, besides.
[good explanation of why not to deleted]
>--
>| Brian S. Kendig \ Macintosh | Engineering, | bskendig |
From page 84 of the UMPG.
From: cbm@well.UUCP (.i.Chris Muir;)
Subject: Re:.c. Modifying the mouse input (SetMouse codein pascal)
Summary: Here's the compliment to GetMouse.
Here's the other side of GetMouse, SetMouse:
procedure SetMouse (where: point);
var
LowGlob: integer;
LowMem: ptr;
PointPtr: ^point;
finalTicks: longint;
const
{some dangerous low-memory-global equates}
MBState = $172; {byte}
MTemp = $828; {point}
RawMouse = $82c; {point}
Mouse = $830; {point}
CrsrNew ready to restore old mouse position}
LowMem := pointer(RawMouse); {point to low memory}
PointPtr := @LowMem^; {treat it as a point}
PointPtr^ := where; {store saved mouse position into it}
LowMem := pointer(MTemp); {point to low memory}
PointPtr := @LowMem^; {treat it as a point}
PointPtr^ := where; {store saved mouse position into it}
LowMem := pointer(CrsrNew);
LowMem^ := $ffff; {both CrsrNew & CrsrCouple}
Delay(5, finalTicks); {let the cursor catch up}
end; {SetMouse}
Note that it uses undocumented low memory globals.
--
___________________________________________________________
Matthew Mora
SRI International mxmora@unix.sri.com
___________________________________________________________
Technical Details
Message-ID:
<12808@unix.SRI.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!bionet!synoptics!unix!mxmoraReferences:
<1990Jun5.091419.14219@portia.Stanford.EDU> <16995@phoenix.Princeton.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!bionet!synoptics!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac Subject: Re: Help! Anyone know how to force the mouse to a location? Message-ID: <12808@unix.SRI.COM> Date: 5 Jun 90 15:51:17 GMT References: <1990Jun5.091419.14219@portia.Stanford.EDU> <16995@phoenix.Princeton.EDU> Reply-To: mxmora@unix.UUCP (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 59