Avoiding mouse polls

David Vaughan dvk at dvkconsult.com.au
Sat Dec 14 15:10:01 EST 2002

On Sunday, Dec 15, 2002, at 06:22 Australia/Sydney, Dar Scott wrote:

> On Saturday, December 14, 2002, at 12:04 PM, Ken Norris (dialup) wrote:
>> But, I still don't think a running loop can be stopped with a mouse 
>> switch
>> action unless you poll for it from inside the loop.
> Everybody's style is different.  To me this is doing it the hard way.  
> I recommend this:
> Drop the loop.  Use a send cycle to cycle through images (and maybe a 
> short period of no-highlight in between).  Use mouseDown to select the 
> current one.  Put the mouseDown handler in the card or the stack.  
> (The card will be like a big button.)

Indeed. This was my message too, Ken. You do not need to poll for 
mouseDown/Up/Release (whichever). They are events, unlike mouseClick 
function, and will be caught between the short pieces of code executed 
by the send-in-time. You do not even need a repeat loop as such. 
Send-in-time can achieve that by sending itself, with local or global 
variables or properties holding the object reference for highlighting, 
and any other state information.

> Is your client area full screen?  Then your mouse location is probably 
> fine.
> Is your window, including decorations, full screen?  Set the mouseLoc 
> to 10,40 or something when your open the stack.
> If neither, do some calculation and put the mouseLoc over the card.
> Is the pointer visible and distracting?  Hide it.  Two ways:  1 Set it 
> to your logo and place it where you want your logo.  This might be 
> better during debugging; you can test with a regular mouse.  2 Set it 
> to blank.
> Dar Scott
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution

More information about the Use-livecode mailing list