Class TKSpatialNavigationManager
Extends
TKObject
.
The spatial navigation manager is a special controller type that sits behind the scenes and handles much of the keyboard interaction in order
to provide navigation between navigable elements of the managedController
. By default, navigation between navigable elements is automatic and
performed based on the location and metrics of each elements. The elements' metrics are those set by CSS and a controller is free to provide custom
metrics for elements as it sees fit by implementing the TKController.customMetricsForElement
method. Additionally, the automatic navigation
can be completely bypassed should the managed controller provide a custom element to navigate to with the
TKController.preferredElementToHighlightInDirection
method.
Defined in: SpatialNavigationManager.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
<static> |
TKSpatialNavigationManager.
busyControllers
The number of controllers that are currently busy, when for instance performing a transition that should not be interrupted.
|
The managed controller is the controller that the spatial navigation manager queries for navigable elements
and any customization of the otherwise automated navigation.
|
|
The complete list of all elements that can be navigated to within this controller and all of its sub-controllers.
|
|
<static> |
TKSpatialNavigationManager.
sharedManager
The shared instance of the spatial navigation manager.
|
<static> |
TKSpatialNavigationManager.
soundToPlay
The identifier for the sound to play for the current event loop.
|
Method Attributes | Method Name and Description |
---|---|
highlightElement (element)
Highlights a given element if it's part of the
navigableElements array. |
|
Highlight the top-most element in the list of navigable elements.
|
|
isElementAtIndexNavigable (element)
Indicates whether a given element is navigable at the provided index in the
navigableElements array. |
- Methods borrowed from class
TKObject
: addPropertyObserver
,callMethodNameAfterDelay
,callSuper
,notifyPropertyChange
,removePropertyObserver
0
, key handling by the spatial navigation manager is suspended.
TKSpatialNavigationManager
}
TKSpatialNavigationManager.sharedManager
TKSpatialNavigationManager
class as needed, and developers should never have to create an instance themselves, instead using this property
to retrieve the shared instance.
navigableElements
array. When an element receives highlight, a highlight
event is
dispatched to that element, while an unhighlight
event is dispatched to the element that previously had highlight.
- Parameters:
-
{
Element
} element - The element to highlight.
navigableElements
array.
- Parameters:
-
{
Element
} element - The index for the element in the
navigableElements
array.
- Returns:
- {bool} Whether the element can be navigated to.