NoriginMedia / Norigin-Spatial-Navigation

React Hooks based Spatial Navigation (Key & Remote Control Navigation) / Web Browsers, Smart TVs and Connected TVs
MIT License
315 stars 94 forks source link

How can I use 'setKeyMap'? #100

Closed KrooCiso closed 11 months ago

KrooCiso commented 12 months ago

Hello, I want to use the remote control's 'back' button with a keycode of 10009. How can I use 'setKeyMap' to configure it? Where should this 'setKeyMap' be placed to make it work? Can you provide a simple example?

asgvard commented 11 months ago

Hi.

This method can be called as soon as you initialize the navigation with init.

Documentation: https://github.com/NoriginMedia/Norigin-Spatial-Navigation#setkeymap You can assign one or multiple key codes to the directions or enter handlers.