Class: FocusController

FocusController

new FocusController ()

Extends

Members

tabGroups Map.<PUXI.TabGroup, Array.<PUXI.FocusableWidget>> protected

Map of tab-group names to the widgets in those groups.

useBack boolean

Whether to enable back arrow key focus movement.

useForward boolean

Whether to enable forward arrow key focus movement.

useTab boolean

Whether to enable tab-based focus movement.

Methods

blur ()

Blurs the currently focused widget out of focus.

focus (item)

Brings the widget into focus.

Name Type Description
item FocusableWidget

in (widget, tabIndex, tabGroup) overrides

Adds the (focusable) widget to the tab group so that pressing tab repeatedly will eventually bring it into focus.

Name Type Default Description
widget PUXI.FocusableWidget

the widget to add

tabIndex number 0 optional

unique index for the widget in tab group used for ordering

tabGroup PUXI.TabGroup 'default' optional

tab group name

notifyBlur ()

Clears the currently focused item without blurring it. It is called when a widget goes out of focus.

notifyFocus (widget)

Called when a widget comes into focus. Do not call this yourself.

Name Type Description
widget FocusableWidget

onBack ()

Focuses the last item without wrapping, i.e. it does not go to the last item if the current item is the first one. This is called when the user presses the back arrow button.

onForward ()

Focuses the next item without wrapping, i.e. it does not go to the first item if the current one is the last item. This is called when the user presses the forward arrow key.

onTab ()

Called when tab is pressed on a focusable widget.

Disables the widget from the controller's state.

Name Type Description
widget PUXI.FocusableWidget