[futurebasic] Re: Setting mouse location

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2001 : Group Archive : Group : All Groups

From: Anders Karl Keller <anderskarlkeller@...>
Date: Thu, 28 Jun 2001 16:45:39 +0700
Run this using the Mac ToolBox runtime. It shouldn't be too much farther to
put it in an INIT, but I don't have time for that many restarts. :o)

Anders



Local FN PutAHurtingOnThatMouseThing
dim UpdateMousePos as boolean
dim thePt as Point
call GetMouse( thePt )

dim ScrnDevHndl&
dim ScrnWidth%
dim ScrnHeight%
ScrnDevHndl& = FN getMainDevice
ScrnWidth% = {[ScrnDevHndl&]+_gdRect_Right}-{[ScrnDevHndl&]+_gdRect_Left}
ScrnHeight% = {[ScrnDevHndl&]+_gdRect_Bottom}-{[ScrnDevHndl&]+_gdRect_Top}

Long if thePt.h% >= ScrnWidth% -1
 thePt.h% = 2
UpdateMousePos = _true
end if
Long if thePt.h% <= 1
 thePt.h% = ScrnWidth% -2
UpdateMousePos = _true
end if
Long if thePt.v% >= ScrnHeight% -1
 thePt.v% = 2
UpdateMousePos = _true
end if
Long if thePt.v% <= 1
 thePt.v% = ScrnHeight% -2
UpdateMousePos = _true
end if

long if UpdateMousePos
  poke long _RawMouse, thePt
  poke long _MTemp,    thePt
  poke word _CrsrNew,  0xFFFF
End If
End FN

dim gEventRecordPtr as ptr

do
fn PutAHurtingOnThatMouseThing
fn getnextevent(_"ffff", gEventRecordPtr)
until fn stilldown



-----------------------------------------------------------
Anders Karl Keller
anderskarlkeller@...
Mac Computer Technical Consultant
Hilltribes Project, International Co-operation for Cambodia
Banlung, Rattanakiri Province, Kingdom of Cambodia