Path: utzoo!attcan!uunet!samsung!usc!apple!well!gurgle From: gurgle@well.sf.ca.us (Pete Gontier) Newsgroups: comp.sys.mac.programmer Subject: Re: How can I move the cursor with THINKC?? Message-ID: <21383@well.sf.ca.us> Date: 27 Oct 90 00:55:51 GMT References: <55432.2723256d@pttrnl.nl> Organization: cellular Lines: 43 In article <55432.2723256d@pttrnl.nl> nugteren@pttrnl.nl writes: >I am writing a trackball driver that would allow connection of an MSDOS Mouse >(actually optical trackball) to a Mac II. One of the problems I have to solve >is how to change to cursor position on the screen from a software level. > This is what I have used in the past (yesterday, in fact). Matt's code is probably just as functional, but I guessed that if you're doing a hardware interface, you don't want an explicit call to Delay for 5 ticks (and might not have access to it). I believe that the line which puts a value into the variable LongMouse does basically what the delay for 5 ticks does. --- cut here --- typedef enum { eCoupled = -1, eUncoupled = 0 } tMouseCouple; extern Point MTemp : 0x0828; extern Point Mouse : 0x0830; extern long LongMouse : 0x0830; extern tMouseCouple CrsrCouple : 0x08CF; extern Point RawMouse : 0x082C; extern Boolean CrsrNew : 0x08CE; extern Boolean CrsrBusy : 0x08CD; /*******************************************/ void SetMouse ( Point p ) { long pinnedPt = PinRect ( & CrsrPin, p ); CrsrBusy = true; /* I'm fucking the mouse; hands off */ CrsrCouple = eUncoupled; /* switch off coupling */ MTemp = p; /* hack interrupt-level mouse coords */ RawMouse = p; /* hack "unjerked" mouse coords */ LongMouse = pinnedPt; /* hack "high-level" mouse coords */ CrsrNew = true; /* hey, mouse VBL, DO IT */ CrsrCouple = eCoupled; /* switch on coupling */ CrsrBusy = false; /* OK, all done */ } -- Pete Gontier, gurgle@well.sf.ca.us Software Imagineer, Kiwi Software, Inc.