エンターキーでタブ移動

【ご質問】
エンターキーでタブ移動することは可能でしょうか?

【回答】
可能です。

詳細は以下のサンプルをご参照ください。

{curl 6.0,7.0,8.0 applet}
{curl-file-attributes character-encoding = “shift-jis”}

{define-proc {prepare-traverse-with-enter
                      atc:ActiveTraversalContainer,
                      target-controls:{Set-of Type},
                      ignore-exception? = true
                  }:void
    {let gui-m:GuiManager = {get-gui-manager}}
    {let fm:#FocusManager = {atc.get-focus-manager}}
    {gui-m.add-event-handler
        {on ke:RawKeyRelease at gui-m do
            {if ke.keycode == Keycode.enter and fm.keyboard-focus-target isa ControlUI then
                def target = fm.keyboard-focus-target asa ControlUI
                def ctl = target.control
                {if {target-controls.member? {type-of ctl}}then
                    {if ke.shift? then
                        {d.traverse forward?=false}
                     else
                        {d.traverse}
                    }
                }
            }
        }
    }
    {return}
}

{def enter-to-move-targets:{Set-of Type} =
    {{Set-of Type}
        TextField
        ,PasswordField
        ||,TextArea || In TextArea, enter key will be kept as a carriage return key.
        ,{type-of {SpinControl}.focus-object} || for DateField and SpinControl
        ,CommandButton
        ,CalendarControl
    }
}

{let d:Dialog
    ={Dialog
         {VBox
             {TextField prompt=“enter to move next”},
             {PasswordField prompt=“enter to move next”},
             {TextDisplay value=“test”},
             {DateField},
             {SpinControl},
             {CalendarControl},
             {CommandButton},
             {TextArea}
         }
     }
}

{value d}

{prepare-traverse-with-enter
    d,
    enter-to-move-targets
}