| Package | feathers.core |
| Class | public class DefaultFocusManager |
| Inheritance | DefaultFocusManager EventDispatcher Object |
| Implements | IFocusManager |
| Product Version : | Feathers 2.0.0 |
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
| Property | Defined 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 | ||
| Method | Defined By | ||
|---|---|---|---|
Constructor. | DefaultFocusManager | ||
![]() | addEventListener(type:String, listener:Function):void Registers an event listener at a certain object. | EventDispatcher | |
![]() | dispatchEvent(event:Event):void Dispatches an event to all objects that have registered listeners for its type. | EventDispatcher | |
![]() | 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 | |
![]() | 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 | |
![]() | removeEventListener(type:String, listener:Function):void Removes an event listener from the object. | EventDispatcher | |
![]() | removeEventListeners(type:String = null):void Removes all event listeners with a certain type, or all of them if type is null. | EventDispatcher | |
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the value of the focus property changes. | DefaultFocusManager | |||
| focus | property |
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.
public function get focus():IFocusDisplayObject public function set focus(value:IFocusDisplayObject):void| isEnabled | property |
isEnabled:BooleanDetermines 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.
public function get isEnabled():Boolean public function set isEnabled(value:Boolean):void| root | property |
root:DisplayObjectContainer [read-only] The top-level container of the focus manager. This isn't necessarily the root of the display list.
public function get root():DisplayObjectContainer| DefaultFocusManager | () | Constructor |
public function DefaultFocusManager(root:DisplayObjectContainer)Constructor.
Parametersroot:DisplayObjectContainer |
| change | Event |
starling.events.Eventstarling.events.Event.CHANGE
Dispatched when the value of the focus property changes.
The properties of the event object have the following values:
| Property | Value |
|---|---|
bubbles | false |
currentTarget | The 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. |
data | null |
target | The 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. |
See also