TVEventHandler JavaScript object. Your app code can create an instance of TVEventHandler and listen for these events, as shown in the following example:
Supported events
TVEventHandler doesn’t allow overriding the default behavior on Vega. For example: pressing the Dpad Left button causes the focus to move onto the component on the left, this is the default behavior provided on Vega. Apps can’t change this behavior even if a listener for the same key is registered in TVEventHandler.
The following is a list of all supported keys on Vega:
Manifest additions
To observe button events on the remote such as left, right, up, and down, you need to add this service entry in your manifest.toml file.Supported actions
The following lists the supported actions:- 0: PRESSED - Button is in pressed or phase down of the key event
- 1: RELEASED - Button is in released or phase up of the key event
Long press detection
When a user presses a button on the remote, the device sends akeyEvents event object consisting of two key-value pairs. The first specifies the event type and the second the event action.
keyEvents events. Each of these events has the same eventType value with a eventKeyAction value of 0. When the button is released, a last event is sent with the same eventType and a eventKeyAction value of 1.
For example, if the user holds the DPad left button for 3 seconds, the following list of event is sent.

