as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
UserInputManager allows app to override the default behavior when D-pad events are received.
UserInputManager is deprecated in React Native Vega, and will be removed in a future release. Please use TVEventHandler instead.

Please use this API with caution

As soon as a listener for a specific keyEvent is registered via UserInputManager, it will replace all the existing listeners, even those that are responsible for the platform behavior. App will have to commit to handling the keypress for the entire lifecycle of the app. Its better to use TVEventHandler if you only need a callback when keys are pressed.

Usage Vega

Reference

Methods

Deprecated. Use the useAddUserInputListenerCallback() hook instead.

UserInputManager.addListener(eventName, callback) Vega

This method allows app to registers listener for specific event, following is a list of all supported events in Vega

useAddUserInputListenerCallback = UserInputListenerCallback Vega

This custom hook returns a callback that, when invoked, will register a listener for specific event. Please make sure to also obey the Rules of Hooks, when calling this hook. The returned callback function takes two paramenters: the UserInputEventName to listen to, and a callback function to invoke when the desired UserInputEventName is pressed. The following is a list of all supported events in Vega:
最后修改于 2026年10月26日