Article View: comp.sys.mac
Article #12499Re: Help! Anyone know how to force the mouse to a location?
From: Joe Holt
Date: Wed, 06 Jun 1990 19:16
Date: Wed, 06 Jun 1990 19:16
71 lines
2091 bytes
2091 bytes
Here is a very short routine which illustrates how to position the cursor.
It is written in Think C. I'll make no judgements regarding who should and
who shouldn't have this knowledge. Enjoy, all.
joe holt
---------- CUT HERE FOR MOUSETO.H ----------
/**************************************************************************
***
*** MouseTo.h
***
*** Position mouse to absolute screen location
***
*** History:
*** jhh jan 90 -- quickie pass
***
***/
#ifndef _H_MOUSETO
#define _H_MOUSETO
/**************************************************************************
**
** Public Functions
**
**/
void
MouseTo(int x, int y);
#endif /* ifndef _H_MOUSETO */
---------- CUT HERE FOR MOUSETO.C ----------
#include "MouseTo.h"
extern Point MTemp : 0x828;
extern Point RawMouse : 0x82C;
extern unsigned char CrsrNew : 0x8CE;
extern unsigned char CrsrCouple : 0x8CF;
/**************************************************************************
***
*** void MouseTo(int x, int y);
***
*** Move the mouse cursor to <x>, <y>. Takes effect immediately.
***
*** History:
*** jhh jan 90 -- quickie pass based on Apple docs
***
***/
void
MouseTo(int x, int y)
{
asm {
move.w y, D0 ; new vertical position
swap D0
move.w x, D0 ; new horizontal position
move.l D0, MTemp
move.l D0, RawMouse
move.b CrsrCouple, CrsrNew
}
}
Technical Details
Message-ID:
<3003@adobe.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!adobe!jholtReferences:
<30981@ut-emx.UUCP> <1990Jun5.091419.14219@portia.Stanford.EDU> <16995@phoenix.Princeton.EDU> <1990Jun5.205342.21561@Neon.Stanford.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!adobe!jholt From: jholt@adobe.COM (Joe Holt) Newsgroups: comp.sys.mac Subject: Re: Help! Anyone know how to force the mouse to a location? Summary: How to... Message-ID: <3003@adobe.UUCP> Date: 6 Jun 90 19:16:27 GMT References: <30981@ut-emx.UUCP> <1990Jun5.091419.14219@portia.Stanford.EDU> <16995@phoenix.Princeton.EDU> <1990Jun5.205342.21561@Neon.Stanford.EDU> Reply-To: jholt@adobe.com (Joe Holt) Organization: Adobe Systems Incorporated, Mountain View Lines: 71