Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content

Gamepad overview

Vega supports gamepad devices for both navigation and game controls in React Native for Vega apps. Gamepads can trigger:
  • Key events (For example, pressing A, B, or triggers)
  • Axis events (For example., moving thumbsticks or the D-Pad)
Apps can consume these inputs by subscribing to either primary, secondary, or both types of events, which are exposed via Vega’s React Native hooks.
  • Primary events are the raw, gamepad-specific inputs such as thumbstick movement or key presses.
  • Secondary events are the high-level TV navigation events such as select, back, up, down that are mapped to gamepad inputs where appropriate.

Input events

Ideally, all gamepads can support multiple input events for a particular key or axis action. For instance, pressing the action button ‘A’ on the gamepad produces a primary event of action_btn_a and a secondary event of select, if the app is subscribed to it. This is useful when an app wants to perform navigation or item selection on the screen using a gamepad instead of a TV remote, as the secondary events provide those capabilities. Vega provides a dedicated hook called useKeplerBackHandler for handling custom back event logic, which doesn’t handle events through useTVEventHandler or TVEventHandler. By default, useKeplerBackHandler returns false if the app hasn’t subscribed to it, meaning that whenever a back button is pressed the system acknowledges it to navigate to previous window. If this behavior is not appropriate for the app or you need to handle the logic from the JavaScript layer, then a subscription must be added through useKeplerBackHandler, and the handler should return true along with any custom logic.

Gamepad input events mapping


Usage Reference

Subscribing to primary/default events

An app can add a subscription to primary events by registering through useGamepadEventHandler. This hook takes a handler method as an argument and returns a GamepadEventSubscription object. The GamepadEventSubscription.enabled property returns a boolean indicating whether the current handler is internally enabled if true and disabled if false. An app can control the subscription to primary events using GamepadEventSubscription.setEnabled. Pass true to enable the hook or false to disable it. The useGamepadEventHandler hook has the following declaration which is exposed to JS layer.
The following are the type definitions and interfaces used in the hook’s definition above and the app must conform to these types.
The following example shows how to import the useGamepadEventHandler hook.
The following example usage shows how to use the useGamepadEventHandler hook in an app.
For information about subscribing to secondary events, see TVEventHandler.
  • TVEventHandler: Use useTVEventHandlerto subscribe to high-level navigation events such as up, down, and select etc.
  • useKeplerBackHandler: Handle back-button events with custom logic from the JavaScript layer.

Last modified on December 10, 2025