Revision: Initiate a tabKey Message

Scott Rossi scott at tactilemedia.com
Thu Mar 13 03:44:01 EST 2003


Recently I wrote:

>> I would like to use arrow keys to navigate between (establish focus on)
>> several fields on a card.  The tab key works perfectly as expected, but I
>> need to use the arrow keys to do the same.  Is this possible without
>> resorting to a hardwired script?
> 
> Here's one answer to my question:
> 
> on arrowKey tKey
> if tKey is in "right,down" then
>   if number of the focusedObject < number of controls of this cd then
>     focus on control (number of the focusedObject + 1)
>   else focus on control 1 of this cd
> else
>   if number of the focusedObject > 1 then
>     focus on control (number of the focusedObject - 1)
>   else focus on control (number of controls of this cd) of this cd
> end if
> end arrowKey

This revised script uses the term "layer" as opposed to "number" and is
apparently more reliable.

 on arrowKey tKey
 if tKey is in "right,down" then
   if layer of the focusedObject < number of controls of this cd then
     focus on control (layer of the focusedObject + 1)
   else focus on control 1 of this cd
 else
   if layer of the focusedObject > 1 then
     focus on control (layer of the focusedObject - 1)
   else focus on control (number of controls of this cd) of this cd
 end if
 end arrowKey

Regards,

Scott Rossi
Creative Director

Tactile Media, Multimedia & Design
Email: scott at tactilemedia.com
Web: www.tactilemedia.com




More information about the metacard mailing list