Packagefeathers.core
Classpublic class DefaultFocusManager
InheritanceDefaultFocusManager Inheritance EventDispatcher Inheritance Object
Implements IFocusManager

Product Version : Feathers 2.0.0

The default IFocusManager implementation. This focus manager is designed to work on both desktop and mobile. Focus may be controlled by Keyboard.TAB (including going backwards when holding the shift key) or with the arrow keys on a d-pad (such as those that appear on a smart TV remote control and some game controllers).

To simulate KeyLocation.D_PAD in the AIR Debug Launcher on desktop for debugging purposes, set DeviceCapabilities.simulateDPad to true.

See also

Keyboard focus management in Feathers
feathers.core.FocusManager


Public Properties
 PropertyDefined By
  focus : IFocusDisplayObject
The object that currently has focus.
DefaultFocusManager
  isEnabled : Boolean
Determines if this focus manager is enabled.
DefaultFocusManager
  root : DisplayObjectContainer
[read-only] The top-level container of the focus manager.
DefaultFocusManager
Public Methods
 MethodDefined By
  
Constructor.
DefaultFocusManager
 Inherited
addEventListener(type:String, listener:Function):void
Registers an event listener at a certain object.
EventDispatcher
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event with the given parameters to all objects that have registered listeners for the given type.
EventDispatcher
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
If called with one argument, figures out if there are any listeners registered for the given event type.
EventDispatcher
 Inherited
removeEventListener(type:String, listener:Function):void
Removes an event listener from the object.
EventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
Events
 Event Summary Defined By
  Dispatched when the value of the focus property changes.DefaultFocusManager
Property Detail
focusproperty
focus:IFocusDisplayObject

The object that currently has focus. May return null if no object has focus.

In the following example, the focus is changed:

    focusManager.focus = someObject;

The default value is null.


Implementation
    public function get focus():IFocusDisplayObject
    public function set focus(value:IFocusDisplayObject):void
isEnabledproperty 
isEnabled:Boolean

Determines if this focus manager is enabled. A focus manager may be disabled when another focus manager has control, such as when a modal pop-up is displayed.

The default value is false.


Implementation
    public function get isEnabled():Boolean
    public function set isEnabled(value:Boolean):void
rootproperty 
root:DisplayObjectContainer  [read-only]

The top-level container of the focus manager. This isn't necessarily the root of the display list.


Implementation
    public function get root():DisplayObjectContainer
Constructor Detail
DefaultFocusManager()Constructor
public function DefaultFocusManager(root:DisplayObjectContainer)

Constructor.

Parameters
root:DisplayObjectContainer
Event Detail
change Event
Event Object Type: starling.events.Event
Event.type property = starling.events.Event.CHANGE

Dispatched when the value of the focus property changes.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
datanull
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.

An event type to be utilized in custom events. Not used by Starling right now.

See also