More on Cmd-tab--useful code snippet

Thomas McCarthy tominjapan at excite.com
Fri Mar 1 19:08:00 EST 2002


I also missed the ability to cycle through the tools using the keyboard as was available in HyperCard.

Here is a piece of code you can put in your project script. I copied the base from the demo stack that came with MetaCard and then added some new ones for choosing tools.  I hope it helps.
the mnenomics are:
s=Stack script
c=Card script
p=Pointer
h=Hand ("browse")
b=Button
f=Field

on commandKeyDown which
  if the optionKey is down then
    switch which
    case "S"
      edit script of the topStack
      break
    case "C"
      edit script of this card of the topStack
      break
    case "B"
      choose button tool
      break
    case "P"
      choose pointer tool
      break
    case "F"
      choose field tool
      break
    case "H"
      choose browse tool
      break
    default
      pass commandKeyDown
    end switch
  else
    if which is "m" then
      modeless "message box"
      exit commandKeyDown
    end if
    if which is "w" then
      save this stack
      close this stack
      exit commandKeyDown
    end if
  end if
  pass commandKeyDown
end commandKeyDown

Cheers,

Tom McCarthy
------------
PerLingua Language Tools
www.perlingua.50megs.com
------------

<hr>



More information about the metacard mailing list