More on Cmd-tab

Scott Raney raney at metacard.com
Thu Feb 28 20:28:00 EST 2002


On Jacqueline Landman Gay <jacque at hyperactivesw.com> wrote:

> I've decided to script MC to use Control-tab to change tools, as a couple 
> of people here suggested. The only problem is that controlKeyDown doesn't 
> seem to recognize the tab key. It does recognize alpha keys, but not 
> control (or Fkeys either). So the question is, how do you script the 
> behavior?
> 
> This yields an empty message when control-tab is typed:
> 
>    on controlkeydown which
>       put which
>    end controlkeydown
> 
> Alpha keys put the correct letter into the message box.

Looks like you get a tabKey message in this case, so you'd have to do:
on tabKey
  if the controlKey
  then # do whatever
end tabKey

Note that "polling" the controlKey in this way is fine
performance-wise, but as has been discussed on the various lists
recently, it's not 100% reliable because it's async (i.e., if the user
lets up the control key between the time they press the tab key and
your handler runs, it will miss the tab key).  I'm starting to think
that what we really need are two sets of functions, one async and one
based on the event queue...

> Also, I routinely load a custom library into the backscripts when MC 
> starts up. I plan to add the above handler to that (if I can get it to 
> work) -- or is there a better place for it somewhere in MC's scripts?

That should work fine, but if any of your other scripts handle tabKey
and don't pass it, you won't get it there.  To be sure, put it in a
frontScript and pass the message if you don't need it.
  Regards,
    Scott

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

********************************************************
Scott Raney  raney at metacard.com  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...




More information about the metacard mailing list