Avoiding mouse polls

curry curry at kagi.com
Sat Dec 14 00:34:00 EST 2002


>  > I can't see any way of doing this without polling for the click.
>>
>>  Ideas?
>
>Is the pointer at some unknown place on the screen, but invisible?  Some
>fixed place?
>
>Maybe you can make the stack full screen and catch the mouse messages at
>the card?
>
>Dar

Yeah--if you have it full screen, then you just need a message to the 
card at repeating intervals that changes the hilited object, and 
mouseup or mousedown in the card that ignores the target and just 
checks by variable which object is currently hilited.

For example, pseudo code, not word for word and not tested:

global theobj,whichobj

on dohilite
add 1 to whichobj
if whichobj > numObjs then put 1 into whichobj
set hilite of control theobj to false
put item which of 
"abutton,another,agraphic,afield,onemore,somethingelse" into theobj
set hilite of control theobj to true
send dohilite to me in howevermany seconds
end

on mousedown
answer "oh man, they clicked for" && theobj
send theyClicked to control theobj
end

Curry




More information about the use-livecode mailing list