Another way to check for any key being down is:

command runTheLoop
   repeat forever
      if the keysDown <> empty then exit repeat
      -- do what you want
   end repeat
end runTheLoop

HTH -
Phil Davis



On 12/15/09 7:59 AM, Robert Brenstein wrote:
On 15.12.2009 at 16:01 Uhr +0100 Jacques Hausser apparently wrote:
Hi Tim

it depends of the kind of loop you are using. Several possibilities For example in a card script:

local stoploop

command runTheLoop
   repeat forever
      if stoploop = "S" then exit repeat
      -- do what you want
      wait 10 milliseconds with message
   end repeat
end runTheLoop

on keyDown thekey
    put thekey into stoploop
end keydown

The "wait x milliseconds with message" is the important trick here.

Jacques



If it is not relevant which key is being pressed, then a tad simpler variation is

command runTheLoop
   repeat forever
      if the shiftkey is down then exit repeat
      -- do what you want
   end repeat
end runTheLoop

It could also be altKey/optionKey or controlKey/commandKey instead of shiftkey.

Robert

--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to