Keyboard Events

Simtech Publications switchedon at hsj.com
Tue Jul 30 13:50:01 EDT 2002


> Setting a flag when the key is first depressed is one way to handle this.

Yes. That's how I had to do it in earlier versions of Director before the
KeyPressed() function.

> How about using a different key, Escape for example? Then you can
> catch it in a rawkeydown handler in the card or stack script.

I'm converting existing Director programs to Revolution in order to deliver
them for Mac OS X. The Mac 68k, Mac PPC and Windows versions all use the
control key. I don't want to risk confusing my customers by using esc for
the OS X versions.

Here is a repeat loop that allows the user to press the control key to
interrupt several seconds of music and return directly to the main menu...

repeat until the sound is done
  if the controlkey is down then
    play stop
    go to cd "main menu"
  end if
end repeat

If that works, I wonder why this doesn't?...

on idle
  if the controlkey is down then go to cd "main menu"
end idle


Cheers... Bill Lynn, Publisher
Simtech Publications
http://www.hsj.com




More information about the use-livecode mailing list