mark at maseurope.net
Sun Mar 19 17:51:28 EST 2006
'wait 0 ticks with messages' was the thing - thanks!
So a general (stack-wide) approach might be to use a custom prop in
in a control, card or stack:
set the canInterrupt of this stack to true
wait 0 ticks with messages
set the canInterrupt of this stack to false
then in the stack script
if the canInterrupt of me then
set the canInterrupt of me to false
exit to top
On 19 Mar 2006, at 22:24, Geoff Canyon wrote:
> On Mar 19, 2006, at 12:04 PM, Mark Smith wrote:
>> Andre, the trouble is that in the case of interrupting a repeat
>> loop, you can't test for whether the escape key is down like you
>> can with control/option/command.
>> So use control/option/command, of course :)
>> But the escape key would be more natural...
> This works:
> local sGetOut
> on mouseUp
> put empty
> put false into sGetOut
> repeat 20000
> wait 0 ticks with messages
> if sGetOut then exit to top
> end repeat
> put "completed"
> end mouseUp
> on escapeKey
> put true into sGetOut
> end escapeKey
> Note that the escapeKey message is delivered to the focused
> control, so you can't put it in a button and expect it to work
> reliably. Put the above in the card script, then click anywhere in
> the card. Some time later "completed" will show in the message box.
> Then click the card again and then press the escape key. You won't
> get the "completed" text.
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the Use-livecode