unlimited undo's for text fields

J. Landman Gay jacque at hyperactivesw.com
Mon Feb 28 10:34:43 CST 2005


On 2/28/05 8:44 AM, Paul wrote:

> I think Dar is right in that a message is not sent when a modifier key 
> is pressed on the Mac, but one can check to see if a modifier key is down.

Yes, but only while a handler is running. For example, you can test:

on mousedown
   if the commandkey is down then...

but you cannot trap alone for the commandkey:

  on commandkeydown
    doSomething

because no message is sent unless the user has also pressed an 
alph-numeric key at the same time. The same applies to the option key 
and control key. Since there is no "shiftKeyDown" message in Transcript 
anyway, you can't trap for that either.

Within a handler, the best way to test for keys that are down is with 
the keysDown() function. But that also fails for command and option 
keys; it does work for shift key however.

So there is no good way to get a signal when the command key, shift key, 
or option key are depressed alone if you need to trap for that behavior 
on a Mac.

As for how other games do it -- I don't know. Scott Raney told me it 
wasn't possible, because the OS sends no message. So I am not sure how 
other game programs manage it.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list