spotlight
Exports the spotlightspotlight.Spotlight object used for controlling spotlight behavior and the spotlightspotlight.Spotlight.getDirection function for mapping a keycode to a spotlight direction.
The default export is spotlightspotlight.Spotlight.
Interactive Demo
Section titled “Interactive Demo ”Members
Section titled “Members ”Spotlight Object
Section titled “Spotlight   Object ”Provides 5-way navigation and focus support
import Spotlight from '@enact/Spotlight';
// get the currently focused component
const current = Spotlight.getCurrent();
// focus an element by CSS selector
Spotlight.focus('.my-custom-class');
// is `current` focusable?
const isFocused = Spotlight.isSpottable(current); getDirection Function
Section titled “getDirection   Function ”getDirection( keyCode ) → String | anyTranslates keyCodes into 5-way direction descriptions (e.g. 'down')
1 Param
- keyCode Number
Key code to analyze
Returns
- String | any
One of
'up','down','left','right'orfalseif not a direction key