Command keys

Richard Gaskin ambassador at fourthworld.com
Tue Mar 30 10:34:08 EST 2004


The MC IDE's frontScript traps commandKeyDown to provide navigation and 
to allow quick script access.  But in one of my apps it was causing 
issues, so I'm wondering:

- Should we remove the Cmd-1 through Cmd-4 parts of the message handler?
   After all, the menu should trigger the same things anyway, and if
   your own menu bar handles those key commands then we should avoid
   conflict.

- Can you think of any downside to modifying the handler so that it
   always passes the commandKeyDown message?

Here's the handler from button "menuButton" of stack "MetaCard Menu Bar":


on commandKeyDown which
   if which is in "1234" then
     set the defaultStack to the topStack
     switch which
     case "1"
       go to first card
       break
     case "2"
       go to prev card
       break
     case "3"
       go to next card
       break
     case "4"
       go to last card
       break
     end switch
   else
     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
       default
         pass commandKeyDown
       end switch
     else pass commandKeyDown
   end if
end commandKeyDown


And the proposed change:


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
     default
       pass commandKeyDown
     end switch
   end if
   pass commandKeyDown
end commandKeyDown



-- 
  Richard Gaskin
  iPoohbah -- interim poohbah for the MC IDE project
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the metacard mailing list